mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +00:00
Port away from KGlobal::mainComponent()
This commit is contained in:
parent
900b523d2b
commit
b15ee4cf70
|
@ -23,10 +23,9 @@
|
|||
|
||||
#include "placesitemeditdialog.h"
|
||||
|
||||
#include <k4aboutdata.h>
|
||||
#include <KAboutData>
|
||||
#include <KDebug>
|
||||
#include <KFile>
|
||||
#include <KGlobal>
|
||||
#include <KIconButton>
|
||||
#include <KLocalizedString>
|
||||
#include <QMimeDatabase>
|
||||
|
@ -161,13 +160,7 @@ void PlacesItemEditDialog::initialize()
|
|||
}
|
||||
|
||||
if (m_allowGlobal) {
|
||||
QString appName;
|
||||
if (KGlobal::mainComponent().aboutData()) {
|
||||
appName = KGlobal::mainComponent().aboutData()->programName();
|
||||
}
|
||||
if (appName.isEmpty()) {
|
||||
appName = KGlobal::mainComponent().componentName();
|
||||
}
|
||||
const QString appName = KAboutData::applicationData().displayName();
|
||||
m_appLocal = new QCheckBox( i18n("&Only show when using this application (%1)", appName ), mainWidget );
|
||||
m_appLocal->setChecked(false);
|
||||
vBox->addWidget(m_appLocal);
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <KComponentData>
|
||||
#include <QStandardPaths>
|
||||
#include <KUser>
|
||||
#include <KGlobal>
|
||||
#include <KAboutData>
|
||||
#include "placesitem.h"
|
||||
#include <QAction>
|
||||
#include <QDate>
|
||||
|
@ -833,8 +833,8 @@ bool PlacesItemModel::acceptBookmark(const KBookmark& bookmark,
|
|||
const bool deviceAvailable = availableDevices.contains(udi);
|
||||
|
||||
const bool allowedHere = (appName.isEmpty()
|
||||
|| appName == KGlobal::mainComponent().componentName()
|
||||
|| appName == KGlobal::mainComponent().componentName() + AppNamePrefix)
|
||||
|| appName == KAboutData::applicationData().componentName()
|
||||
|| appName == KAboutData::applicationData().componentName() + AppNamePrefix)
|
||||
&& (m_fileIndexingEnabled || (url.scheme() != QLatin1String("timeline") &&
|
||||
url.scheme() != QLatin1String("search")));
|
||||
|
||||
|
@ -853,7 +853,7 @@ PlacesItem* PlacesItemModel::createSystemPlacesItem(const SystemBookmarkData& da
|
|||
// As long as the KFilePlacesView from kdelibs is available, the system-bookmarks
|
||||
// for "Recently Saved" and "Search For" should be a setting available only
|
||||
// in the Places Panel (see description of AppNamePrefix for more details).
|
||||
const QString appName = KGlobal::mainComponent().componentName() + AppNamePrefix;
|
||||
const QString appName = KAboutData::applicationData().componentName() + AppNamePrefix;
|
||||
bookmark.setMetaDataItem("OnlyInApp", appName);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue