From 7f2af785f9d4877fa3490f276e5fc2b55853a5e5 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Fri, 1 Jul 2011 16:08:21 +0200 Subject: [PATCH] Welcome Screen: Don't try to load FDO icons when not on linux Change-Id: I5bfaf78dddb27c42ad515f9506857dace571efd4 Reviewed-on: http://codereview.qt.nokia.com/1009 Reviewed-by: Qt Sanity Bot Reviewed-by: Daniel Molkentin --- .../welcomescreen/widgets/Feedback.qml | 10 +++++++--- src/plugins/welcome/welcomeplugin.cpp | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/welcomescreen/widgets/Feedback.qml b/share/qtcreator/welcomescreen/widgets/Feedback.qml index 839e9cbeb42..a712746492a 100644 --- a/share/qtcreator/welcomescreen/widgets/Feedback.qml +++ b/share/qtcreator/welcomescreen/widgets/Feedback.qml @@ -10,11 +10,15 @@ BorderImage { Rectangle { color: "black"; width: parent.width; height: 1; anchors.top: parent.top; anchors.left: parent.left } - Components.Button { + Components.QStyleItem { id: styleItem; visible: false } + // whitelist + property bool _hasDesktopTheme: welcomeMode.platform() === "linux" + + Components.Button { id: openProjectButton text: qsTr("Open Project...") - iconSource: "image://desktoptheme/document-open" + iconSource: _hasDesktopTheme ? "image://desktoptheme/document-open" : "" onClicked: welcomeMode.openProject(); height: 32 anchors.left: parent.left @@ -25,7 +29,7 @@ BorderImage { Components.Button { id: createProjectButton text: qsTr("Create Project...") - iconSource: "image://desktoptheme/document-new" + iconSource: _hasDesktopTheme ? "image://desktoptheme/document-new" : "" onClicked: welcomeMode.newProject(); height: 32 anchors.left: openProjectButton.right diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index d4ef9148bb9..0196bda8080 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -97,6 +97,8 @@ public: void initPlugins(); int activePlugin() const { return m_activePlugin; } + Q_SCRIPTABLE QString platform() const; + public slots: void sendFeedback(); void newProject(); @@ -195,6 +197,21 @@ void WelcomeMode::initPlugins() QUrl::fromLocalFile(Core::ICore::instance()->resourcePath() + "/welcomescreen/welcomescreen.qml")); } +QString WelcomeMode::platform() const +{ +#if defined(Q_OS_WIN) + return QLatin1String("windows"); +#elif defined(Q_OS_MAC) + return QLatin1String("mac"); +#elif defined(Q_OS_LINUX) + return QLatin1String("linux"); +#elif defined(Q_OS_UNIX) + return QLatin1String("unix"); +#else + return QLatin1String("other") +#endif +} + void WelcomeMode::welcomePluginAdded(QObject *obj) { if (Utils::IWelcomePage *plugin = qobject_cast(obj)) {