RecentDocuments::RecentDocuments(QObject *parent, const QVariantList& args) : Plasma::AbstractRunner(parent, args) { Q_UNUSED(args); setObjectName( QLatin1String("Recent Documents" )); m_icon = QIcon::fromTheme("document-open-recent"); loadRecentDocuments(); // listen for changes to the list of recent documents KDirWatch *recentDocWatch = new KDirWatch(this); recentDocWatch->addDir(KRecentDocument::recentDocumentDirectory(), KDirWatch::WatchFiles); connect(recentDocWatch,SIGNAL(created(QString)),this,SLOT(loadRecentDocuments())); connect(recentDocWatch,SIGNAL(deleted(QString)),this,SLOT(loadRecentDocuments())); connect(recentDocWatch,SIGNAL(dirty(QString)),this,SLOT(loadRecentDocuments())); addSyntax(Plasma::RunnerSyntax(":q:", i18n("Looks for documents recently used with names matching :q:."))); }
RecentDocuments::RecentDocuments(QObject *parent, const QVariantList& args) : Plasma::AbstractRunner(parent, args) { Q_UNUSED(args); setObjectName( QStringLiteral("Recent Documents" )); loadRecentDocuments(); // listen for changes to the list of recent documents KDirWatch *recentDocWatch = new KDirWatch(this); recentDocWatch->addDir(KRecentDocument::recentDocumentDirectory(), KDirWatch::WatchFiles); connect(recentDocWatch, &KDirWatch::created, this, &RecentDocuments::loadRecentDocuments); connect(recentDocWatch, &KDirWatch::deleted, this, &RecentDocuments::loadRecentDocuments); connect(recentDocWatch, &KDirWatch::dirty, this, &RecentDocuments::loadRecentDocuments); addSyntax(Plasma::RunnerSyntax(QStringLiteral(":q:"), i18n("Looks for documents recently used with names matching :q:."))); }