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