Porting tabbox to Qt5/KF5: QStandardPaths

REVIEW: 111973
This commit is contained in:
Anselmo L. S. Melo 2013-08-03 17:33:50 -03:00
parent c2942c4e73
commit a9c346ad83

View file

@ -30,6 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtGui/QResizeEvent> #include <QtGui/QResizeEvent>
#include <QQuickItem> #include <QQuickItem>
#include <QX11Info> #include <QX11Info>
#include <QtCore/QStandardPaths>
// include KDE // include KDE
#include <KDE/KDebug> #include <KDE/KDebug>
@ -37,7 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KDE/KIconEffect> #include <KDE/KIconEffect>
#include <KDE/KIconLoader> #include <KDE/KIconLoader>
#include <KDE/KServiceTypeTrader> #include <KDE/KServiceTypeTrader>
#include <KDE/KStandardDirs>
#include <KDE/Plasma/FrameSvg> #include <KDE/Plasma/FrameSvg>
#include <KDE/Plasma/Theme> #include <KDE/Plasma/Theme>
#include <kwindoweffects.h> #include <kwindoweffects.h>
@ -149,7 +149,7 @@ DeclarativeView::DeclarativeView(QAbstractItemModel *model, TabBoxConfig::TabBox
} else if (m_mode == TabBoxConfig::DesktopTabBox) { } else if (m_mode == TabBoxConfig::DesktopTabBox) {
rootContext()->setContextProperty(QStringLiteral("clientModel"), model); rootContext()->setContextProperty(QStringLiteral("clientModel"), model);
} }
setSource(QUrl(KStandardDirs::locate("data", QLatin1String(KWIN_NAME) + QLatin1String("/tabbox/tabbox.qml")))); setSource(QUrl(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String(KWIN_NAME) + QLatin1String("/tabbox/tabbox.qml"))));
// FrameSvg // FrameSvg
m_frame->setImagePath(QStringLiteral("dialogs/background")); m_frame->setImagePath(QStringLiteral("dialogs/background"));
@ -391,14 +391,14 @@ QString DeclarativeView::findWindowSwitcherScriptFile(KService::Ptr service)
{ {
const QString pluginName = service->property(QStringLiteral("X-KDE-PluginInfo-Name")).toString(); const QString pluginName = service->property(QStringLiteral("X-KDE-PluginInfo-Name")).toString();
const QString scriptName = service->property(QStringLiteral("X-Plasma-MainScript")).toString(); const QString scriptName = service->property(QStringLiteral("X-Plasma-MainScript")).toString();
return KStandardDirs::locate("data", QStringLiteral(KWIN_NAME) + QStringLiteral("/tabbox/") + pluginName + QStringLiteral("/contents/") + scriptName); return QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME) + QStringLiteral("/tabbox/") + pluginName + QStringLiteral("/contents/") + scriptName);
} }
QString DeclarativeView::findDesktopSwitcherScriptFile(KService::Ptr service) QString DeclarativeView::findDesktopSwitcherScriptFile(KService::Ptr service)
{ {
const QString pluginName = service->property(QStringLiteral("X-KDE-PluginInfo-Name")).toString(); const QString pluginName = service->property(QStringLiteral("X-KDE-PluginInfo-Name")).toString();
const QString scriptName = service->property(QStringLiteral("X-Plasma-MainScript")).toString(); const QString scriptName = service->property(QStringLiteral("X-Plasma-MainScript")).toString();
return KStandardDirs::locate("data", QStringLiteral(KWIN_NAME) + QStringLiteral("/desktoptabbox/") + pluginName + QStringLiteral("/contents/") + scriptName); return QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral(KWIN_NAME) + QStringLiteral("/desktoptabbox/") + pluginName + QStringLiteral("/contents/") + scriptName);
} }
void DeclarativeView::slotEmbeddedChanged(bool enabled) void DeclarativeView::slotEmbeddedChanged(bool enabled)