mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
kdeplasma-addons: deal with FIXME related to recentdocuments applet
note that KRecentFilesAction does not clear actions that are not in the config (e.g. entries stored in ~/.katana/share/apps/RecentDocuments or xbel file) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
3835a88a75
commit
3f8c7e4f62
2 changed files with 3 additions and 21 deletions
|
@ -116,16 +116,11 @@ void RecentDocuments::setEnabled(bool enabled)
|
||||||
foreach (File f, m_files) {
|
foreach (File f, m_files) {
|
||||||
m_watcher->addFile(f.path);
|
m_watcher->addFile(f.path);
|
||||||
}
|
}
|
||||||
connect(m_watcher, SIGNAL(dirty(QString)), this, SLOT(modified(QString)));
|
connect(m_watcher, SIGNAL(dirty(QString)), this, SLOT(readCurrentDocs()));
|
||||||
#warning FIXME: reload recent files on dirty() signal
|
|
||||||
#if 0
|
|
||||||
connect(m_watcher, SIGNAL(created(QString)), this, SLOT(added(QString)));
|
|
||||||
connect(m_watcher, SIGNAL(deleted(QString)), this, SLOT(removed(QString)));
|
|
||||||
#endif
|
|
||||||
connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(sycocaChanged(const QStringList &)));
|
connect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(sycocaChanged(const QStringList &)));
|
||||||
readCurrentDocs();
|
readCurrentDocs();
|
||||||
} else if (m_enabled) {
|
} else if (m_enabled) {
|
||||||
disconnect(m_watcher, SIGNAL(dirty(QString)), this, SLOT(modified(QString)));
|
disconnect(m_watcher, SIGNAL(dirty(QString)), this, SLOT(readCurrentDocs()));
|
||||||
disconnect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(sycocaChanged(const QStringList &)));
|
disconnect(KSycoca::self(), SIGNAL(databaseChanged(QStringList)), this, SLOT(sycocaChanged(const QStringList &)));
|
||||||
delete m_watcher;
|
delete m_watcher;
|
||||||
m_watcher = 0;
|
m_watcher = 0;
|
||||||
|
@ -237,18 +232,6 @@ void RecentDocuments::removed(const QString &path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RecentDocuments::modified(const QString &path)
|
|
||||||
{
|
|
||||||
QList<File>::Iterator it(m_files.begin()),
|
|
||||||
end(m_files.end());
|
|
||||||
for (; it != end; ++it) {
|
|
||||||
if ((*it).path == path) {
|
|
||||||
(*it).dirty = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void RecentDocuments::sycocaChanged(const QStringList &types)
|
void RecentDocuments::sycocaChanged(const QStringList &types)
|
||||||
{
|
{
|
||||||
if (types.contains("apps") || types.contains("xdgdata-apps")) {
|
if (types.contains("apps") || types.contains("xdgdata-apps")) {
|
||||||
|
|
|
@ -70,12 +70,11 @@ public:
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void added(const QString& path);
|
void added(const QString& path);
|
||||||
void removed(const QString& path);
|
void removed(const QString& path);
|
||||||
void modified(const QString& path);
|
|
||||||
void sycocaChanged(const QStringList &types);
|
void sycocaChanged(const QStringList &types);
|
||||||
void loadDoc();
|
void loadDoc();
|
||||||
|
void readCurrentDocs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void readCurrentDocs();
|
|
||||||
void load();
|
void load();
|
||||||
App officeAppForMimeType(const QString &mimeType);
|
App officeAppForMimeType(const QString &mimeType);
|
||||||
App appForExec(const QString &execString);
|
App appForExec(const QString &execString);
|
||||||
|
|
Loading…
Add table
Reference in a new issue