summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2010-01-08 14:33:06 (GMT)
committerAlexis Menard <alexis.menard@nokia.com>2010-01-08 15:16:50 (GMT)
commit319b0262418d74cc416a7dd1f620b54ba45bad22 (patch)
treee4c8b7af34eb0ee8b2970ec54bfe5aea8f861bbd /src/gui/dialogs
parent2e62227f950aac8205f2b67e4d7d046836b2c799 (diff)
downloadQt-319b0262418d74cc416a7dd1f620b54ba45bad22.zip
Qt-319b0262418d74cc416a7dd1f620b54ba45bad22.tar.gz
Qt-319b0262418d74cc416a7dd1f620b54ba45bad22.tar.bz2
Obsolete QDirModel and remove it from the doc.
QFileSystemModel provides the same features as QDirModel but in a efficient way so no need to keep QDirModel around. This commit mark as obsolete QDirModel. Examples has been ported to use QFileSystemModel instead. QCompleter also gain the support of QFileSystemModel to complete nicely a line edit. This commit also add a new signal in QFileSystemModel when the directory is loaded, i.e. the thread has finished to read the current dir. Task-number:QTBUG-3884 Reviewed-by:ogoffart Reviewed-by:gabi Reviewed-by:mbm
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qfileinfogatherer.cpp1
-rw-r--r--src/gui/dialogs/qfileinfogatherer_p.h1
-rw-r--r--src/gui/dialogs/qfilesystemmodel.cpp10
-rw-r--r--src/gui/dialogs/qfilesystemmodel.h1
4 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/dialogs/qfileinfogatherer.cpp b/src/gui/dialogs/qfileinfogatherer.cpp
index 2729530..bcabb20 100644
--- a/src/gui/dialogs/qfileinfogatherer.cpp
+++ b/src/gui/dialogs/qfileinfogatherer.cpp
@@ -354,6 +354,7 @@ void QFileInfoGatherer::getFileInfos(const QString &path, const QStringList &fil
}
if (!updatedFiles.isEmpty())
emit updates(path, updatedFiles);
+ emit directoryLoaded(path);
}
void QFileInfoGatherer::fetch(const QFileInfo &fileInfo, QTime &base, bool &firstTime, QList<QPair<QString, QFileInfo> > &updatedFiles, const QString &path) {
diff --git a/src/gui/dialogs/qfileinfogatherer_p.h b/src/gui/dialogs/qfileinfogatherer_p.h
index b722410..db4e1d0 100644
--- a/src/gui/dialogs/qfileinfogatherer_p.h
+++ b/src/gui/dialogs/qfileinfogatherer_p.h
@@ -155,6 +155,7 @@ Q_SIGNALS:
void updates(const QString &directory, const QList<QPair<QString, QFileInfo> > &updates);
void newListOfFiles(const QString &directory, const QStringList &listOfFiles) const;
void nameResolved(const QString &fileName, const QString &resolvedName) const;
+ void directoryLoaded(const QString &path);
public:
QFileInfoGatherer(QObject *parent = 0);
diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp
index 6ec80a9..063f979 100644
--- a/src/gui/dialogs/qfilesystemmodel.cpp
+++ b/src/gui/dialogs/qfilesystemmodel.cpp
@@ -150,6 +150,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
+ \since 4.7
+ \fn void QFileSystemModel::directoryLoaded(const QString &path)
+
+ This signal is emitted when the gatherer thread has finished to load the \a path.
+
+*/
+
+/*!
\fn bool QFileSystemModel::remove(const QModelIndex &index) const
Removes the model item \a index from the file system model and \bold{deletes the
@@ -1869,6 +1877,8 @@ void QFileSystemModelPrivate::init()
q, SLOT(_q_fileSystemChanged(QString,QList<QPair<QString,QFileInfo> >)));
q->connect(&fileInfoGatherer, SIGNAL(nameResolved(QString,QString)),
q, SLOT(_q_resolvedName(QString,QString)));
+ q->connect(&fileInfoGatherer, SIGNAL(directoryLoaded(QString)),
+ q, SIGNAL(directoryLoaded(QString)));
q->connect(&delayedSortTimer, SIGNAL(timeout()), q, SLOT(_q_performDelayedSort()), Qt::QueuedConnection);
}
diff --git a/src/gui/dialogs/qfilesystemmodel.h b/src/gui/dialogs/qfilesystemmodel.h
index 4a3c892..a41bc3f 100644
--- a/src/gui/dialogs/qfilesystemmodel.h
+++ b/src/gui/dialogs/qfilesystemmodel.h
@@ -70,6 +70,7 @@ class Q_GUI_EXPORT QFileSystemModel : public QAbstractItemModel
Q_SIGNALS:
void rootPathChanged(const QString &newPath);
void fileRenamed(const QString &path, const QString &oldName, const QString &newName);
+ void directoryLoaded(const QString &path);
public:
enum Roles {