[developerteam getadooble] SF.net SVN: dooble:[1956] trunk/browser
Brought to you by:
textfield
|
From: <tex...@us...> - 2011-02-15 17:13:56
|
Revision: 1956
http://dooble.svn.sourceforge.net/dooble/?rev=1956&view=rev
Author: textfield
Date: 2011-02-15 17:13:49 +0000 (Tue, 15 Feb 2011)
Log Message:
-----------
Improved file manager (new columns).
Modified Paths:
--------------
trunk/browser/Doc/RELEASE-NOTES
trunk/browser/Doc/TO-DO
trunk/browser/Include/dfilemanager.h
trunk/browser/Source/dfilemanager.cc
trunk/browser/Source/dooble.cc
trunk/browser/dooble.osx.pro
trunk/browser/dooble.pro
trunk/browser/dooble.win.pro
Added Paths:
-----------
trunk/browser/Include/dfilesystemmodel.h
trunk/browser/Source/dfilesystemmodel.cc
Modified: trunk/browser/Doc/RELEASE-NOTES
===================================================================
--- trunk/browser/Doc/RELEASE-NOTES 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/Doc/RELEASE-NOTES 2011-02-15 17:13:49 UTC (rev 1956)
@@ -36,6 +36,10 @@
21. Cookie information is now stored in the cookies.db database.
22. Replaced many instances of QSettings. This minor change should improve
performance as disk access will be minimized.
+23. Extended the file manager's table view to include data accessed, owner,
+ and permissions information.
+24. Now displaying hidden files in the file manager's table view.
+25. Adjusted lengths of history menu items.
1.17
Modified: trunk/browser/Doc/TO-DO
===================================================================
--- trunk/browser/Doc/TO-DO 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/Doc/TO-DO 2011-02-15 17:13:49 UTC (rev 1956)
@@ -47,6 +47,7 @@
QWebSettings::setIconDatabasePath().
36. Retain download information, if instructed to do so.
37. Store cookies to permanent storage.
+38. Expand the file manager's columns. Add permissions, owner, etc.
In Progress
@@ -69,4 +70,3 @@
apparent when the user has initiated a load from beyond the
contents of a page. That is, clicked links do not instigate this
issue.
-13. Expand the file manager's columns. Add permissions, owner, etc.
Modified: trunk/browser/Include/dfilemanager.h
===================================================================
--- trunk/browser/Include/dfilemanager.h 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/Include/dfilemanager.h 2011-02-15 17:13:49 UTC (rev 1956)
@@ -58,6 +58,7 @@
#include "dwebhistory.h"
#include "dwebhistoryitem.h"
+#include "dfilesystemmodel.h"
#include "ui_fileManagerForm.h"
class dfilemanager: public QWidget
@@ -68,7 +69,7 @@
dfilemanager(QWidget *parent);
~dfilemanager();
static QFileSystemModel *treeModel;
- static QFileSystemModel *tableModel;
+ static dfilesystemmodel *tableModel;
QUrl url(void) const;
void back(void);
void load(const QUrl &url);
Added: trunk/browser/Include/dfilesystemmodel.h
===================================================================
--- trunk/browser/Include/dfilesystemmodel.h (rev 0)
+++ trunk/browser/Include/dfilesystemmodel.h 2011-02-15 17:13:49 UTC (rev 1956)
@@ -0,0 +1,69 @@
+/****************************************************************************
+** Dooble - The Secure Internet Web Browser
+**
+** Copyright (c) 2011 Alexis Megas,
+** Gunther van Dooble, and the Dooble Team.
+** All rights reserved.
+**
+** License: GPL2 only:
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; version 2 of the License only.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+** or see here: http://www.gnu.org/licenses/gpl.html
+**
+** For the WebKit library, please see: http://webkit.org.
+**
+** THE CODE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY
+** EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+** GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+** IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+** ARISING IN ANY WAY OUT OF THE USE OF THIS APPLICATION, EVEN IF ADVISED
+** OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** Please report all praise, requests, bugs, and problems to the project
+** team and administrators: http://sf.net/projects/dooble.
+**
+** You can find us listed at our project page. New team members are welcome.
+** The name of the authors should not be used to endorse or promote products
+** derived from Dooble without specific prior written permission.
+** If you use this code for other projects, please let us know.
+**
+** Web sites:
+** http://sf.net/projects/dooble
+** http://dooble.sf.net
+****************************************************************************/
+
+#ifndef _dfilesystemmodel_h_
+#define _dfilesystemmodel_h_
+
+#include <QFileSystemModel>
+
+class dfilesystemmodel: public QFileSystemModel
+{
+ Q_OBJECT
+
+ public:
+ dfilesystemmodel(QObject *parent = 0);
+
+ private:
+ int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+ QVariant headerData(int section, Qt::Orientation orientation,
+ int role = Qt::DisplayRole ) const;
+};
+
+#endif
Modified: trunk/browser/Source/dfilemanager.cc
===================================================================
--- trunk/browser/Source/dfilemanager.cc 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/Source/dfilemanager.cc 2011-02-15 17:13:49 UTC (rev 1956)
@@ -58,8 +58,8 @@
#include "dfilemanager.h"
+dfilesystemmodel *dfilemanager::tableModel = 0;
QFileSystemModel *dfilemanager::treeModel = 0;
-QFileSystemModel *dfilemanager::tableModel = 0;
dfilemanager::dfilemanager(QWidget *parent):QWidget(parent)
{
@@ -87,7 +87,7 @@
SLOT(slotDirectoryRemoved(const QModelIndex &, int, int)));
treeModel->setFilter(QDir::Drives | QDir::AllDirs | QDir::NoDotAndDotDot);
treeModel->setRootPath(QDir::rootPath());
- tableModel->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot);
+ tableModel->setFilter(QDir::Hidden | QDir::AllEntries | QDir::NoDotAndDotDot);
tableModel->setRootPath(QDir::rootPath());
ui.treeView->setModel(treeModel);
ui.treeView->setSortingEnabled(true);
@@ -203,6 +203,7 @@
(ui.tableView->model());
str += "<html>\n";
+ str += ui.pathLabel->text() + "\n";
str += "<table border=\"0\">\n";
str += "<tr>\n";
Added: trunk/browser/Source/dfilesystemmodel.cc
===================================================================
--- trunk/browser/Source/dfilesystemmodel.cc (rev 0)
+++ trunk/browser/Source/dfilesystemmodel.cc 2011-02-15 17:13:49 UTC (rev 1956)
@@ -0,0 +1,160 @@
+/****************************************************************************
+** Dooble - The Secure Internet Web Browser
+**
+** Copyright (c) 2011 Alexis Megas,
+** Gunther van Dooble, and the Dooble Team.
+** All rights reserved.
+**
+** License: GPL2 only:
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; version 2 of the License only.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+** or see here: http://www.gnu.org/licenses/gpl.html
+**
+** For the WebKit library, please see: http://webkit.org.
+**
+** THE CODE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY
+** EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+** PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+** GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+** IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+** ARISING IN ANY WAY OUT OF THE USE OF THIS APPLICATION, EVEN IF ADVISED
+** OF THE POSSIBILITY OF SUCH DAMAGE.
+**
+** Please report all praise, requests, bugs, and problems to the project
+** team and administrators: http://sf.net/projects/dooble.
+**
+** You can find us listed at our project page. New team members are welcome.
+** The name of the authors should not be used to endorse or promote products
+** derived from Dooble without specific prior written permission.
+** If you use this code for other projects, please let us know.
+**
+** Web sites:
+** http://sf.net/projects/dooble
+** http://dooble.sf.net
+****************************************************************************/
+
+#include <QDateTime>
+
+#include "dfilesystemmodel.h"
+
+dfilesystemmodel::dfilesystemmodel(QObject *parent):QFileSystemModel(parent)
+{
+}
+
+QVariant dfilesystemmodel::headerData(int section, Qt::Orientation orientation,
+ int role) const
+{
+ if(orientation == Qt::Horizontal && role == Qt::DisplayRole)
+ {
+ switch(section)
+ {
+ case 0:
+ {
+ return tr("Name");
+ }
+ case 1:
+ {
+ return tr("Size");
+ }
+ case 2:
+ {
+ return tr("Type");
+ }
+ case 3:
+ {
+ return tr("Date Modified");
+ }
+ case 4:
+ {
+ return tr("Date Accessed");
+ }
+ case 5:
+ {
+ return tr("Owner");
+ }
+ case 6:
+ {
+ return tr("Permissions");
+ }
+ default:
+ break;
+ }
+ }
+
+ return QFileSystemModel::headerData(section, orientation, role);
+}
+
+int dfilesystemmodel::columnCount(const QModelIndex &parent) const
+{
+ Q_UNUSED(parent);
+ return 7;
+}
+
+QVariant dfilesystemmodel::data(const QModelIndex &index, int role) const
+{
+ if(role == Qt::DisplayRole)
+ {
+ switch(index.column())
+ {
+ case 4:
+ return QVariant(fileInfo(index).lastRead());
+ case 5:
+ return QVariant(fileInfo(index).owner());
+ case 6:
+ {
+ QString p("");
+ QFile::Permissions permissions(fileInfo(index).permissions());
+
+#ifdef Q_OS_UNIX
+ static QString s_array[] = {"r", "w", "x",
+ "r", "w", "x",
+ "r", "w", "x"};
+ static QFile::Permission e_array[] =
+ {QFile::ReadOwner, QFile::WriteOwner, QFile::ExeOwner,
+ QFile::ReadGroup, QFile::WriteGroup, QFile::ExeGroup,
+ QFile::ReadOther, QFile::WriteOther, QFile::ExeOther};
+
+ for(int i = 0; i < 9; i++)
+ if(permissions & e_array[i])
+ p += s_array[i];
+ else
+ p += "-";
+#elif defined Q_OS_WIN32
+ static QString s_array[] = {"r", "w", "x",
+ "r", "w", "x",
+ "r", "w", "x"};
+ static QFile::Permission e_array[] =
+ {QFile::ReadUser, QFile::WriteUser, QFile::ExeUser,
+ QFile::ReadGrour, QFile::WriteGroup, QFile::ExeGroup,
+ QFile::ReadOther, QFile::WriteOther, QFile::ExeOther};
+
+ for(int i = 0; i < 9; i++)
+ if(permissions & e_array[i])
+ p += s_array[i];
+ else
+ p += "-";
+#endif
+
+ return p;
+ }
+ default:
+ break;
+ }
+ }
+
+ return QFileSystemModel::data(index, role);
+}
Modified: trunk/browser/Source/dooble.cc
===================================================================
--- trunk/browser/Source/dooble.cc 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/Source/dooble.cc 2011-02-15 17:13:49 UTC (rev 1956)
@@ -329,7 +329,7 @@
*/
dfilemanager::treeModel = new QFileSystemModel();
- dfilemanager::tableModel = new QFileSystemModel();
+ dfilemanager::tableModel = new dfilesystemmodel();
/*
** Create singular instances.
@@ -1424,10 +1424,6 @@
title = p->url().toString(QUrl::StripTrailingSlash);
- /*
- ** Restrict the size of the tab.
- */
-
ui.tabWidget->setTabText(ui.tabWidget->indexOf(p),
title.replace("&", "&&"));
ui.tabWidget->setTabToolTip(ui.tabWidget->indexOf(p),
@@ -1559,6 +1555,11 @@
if(title.contains("&"))
title = title.replace("&", "&&");
+ if(title.length() > MAX_NUMBER_OF_MENU_TITLE_CHARACTERS)
+ title = title.mid
+ (0, MAX_NUMBER_OF_MENU_TITLE_CHARACTERS - 3) +
+ "...";
+
/*
** 3 = Clear History, Show History, and a separator.
*/
Modified: trunk/browser/dooble.osx.pro
===================================================================
--- trunk/browser/dooble.osx.pro 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/dooble.osx.pro 2011-02-15 17:13:49 UTC (rev 1956)
@@ -48,6 +48,7 @@
Include/ddesktopwidget.h \
Include/ddownloadwindow.h \
Include/dwebhistoryitem.h \
+ Include/dfilesystemmodel.h \
Include/dpagesourcewindow.h \
Include/ddownloadwindowitem.h \
Include/dgenericsearchwidget.h
@@ -69,6 +70,7 @@
Source/ddesktopwidget.cc \
Source/ddownloadwindow.cc \
Source/dwebhistoryitem.cc \
+ Source/dfilesystemmodel.cc \
Source/dpagesourcewindow.cc \
Source/ddownloadwindowitem.cc \
Source/dgenericsearchwidget.cc
Modified: trunk/browser/dooble.pro
===================================================================
--- trunk/browser/dooble.pro 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/dooble.pro 2011-02-15 17:13:49 UTC (rev 1956)
@@ -46,6 +46,7 @@
Include/ddesktopwidget.h \
Include/ddownloadwindow.h \
Include/dwebhistoryitem.h \
+ Include/dfilesystemmodel.h \
Include/dpagesourcewindow.h \
Include/ddownloadwindowitem.h \
Include/dgenericsearchwidget.h
@@ -67,6 +68,7 @@
Source/ddesktopwidget.cc \
Source/ddownloadwindow.cc \
Source/dwebhistoryitem.cc \
+ Source/dfilesystemmodel.cc \
Source/dpagesourcewindow.cc \
Source/ddownloadwindowitem.cc \
Source/dgenericsearchwidget.cc
Modified: trunk/browser/dooble.win.pro
===================================================================
--- trunk/browser/dooble.win.pro 2011-02-15 01:13:02 UTC (rev 1955)
+++ trunk/browser/dooble.win.pro 2011-02-15 17:13:49 UTC (rev 1956)
@@ -46,6 +46,7 @@
Include\\ddesktopwidget.h \
Include\\ddownloadwindow.h \
Include\\dwebhistoryitem.h \
+ Include\\dfilesystemmodel.h \
Include\\dpagesourcewindow.h \
Include\\ddownloadwindowitem.h \
Include\\dgenericsearchwidget.h
@@ -67,6 +68,7 @@
Source\\ddesktopwidget.cc \
Source\\ddownloadwindow.cc \
Source\\dwebhistoryitem.cc \
+ Source\\dfilesystemmodel.cc \
Source\\dpagesourcewindow.cc \
Source\\ddownloadwindowitem.cc \
Source\\dgenericsearchwidget.cc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|