From 009d56a08c8865531983e4127ae335a650b49dd9 Mon Sep 17 00:00:00 2001 From: dobo90 Date: Sun, 1 Dec 2013 01:14:07 +0100 Subject: [PATCH] razorqt first commit --- .lxqtguiplatformplugin.cpp.swp | Bin 0 -> 12288 bytes CMakeLists.txt | 14 +++++++------- README | 18 ++++++++++++++++++ lxqtguiplatformplugin.cpp | 27 ++++++++++++++++++++------- lxqtguiplatformplugin.h | 7 +++++-- 5 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 .lxqtguiplatformplugin.cpp.swp diff --git a/.lxqtguiplatformplugin.cpp.swp b/.lxqtguiplatformplugin.cpp.swp new file mode 100644 index 0000000000000000000000000000000000000000..72fa932d9903e56471c8f16ed9de70a439a071c7 GIT binary patch literal 12288 zcmeI2O>84c6~}8A7(SNW8FmM_zVV_RJL}jMs z>8^Ih!|ouhKzxX=6A}vo?GYqELR>f?@gWXy0Eq)a99SW7LY$C*6NvvSx05*QOfpAM zTl&T6>Q}Go{p-Eziqf5>o8=vPG53PN=aLZjUwOS*$z{dgKOltVcYJO>>thC8do(!9 zN{9#SFdvxr{ot-zysL(8)OWnRd+)C5N6yeSRnHFwlh#~!I6T{9Vv#72C~z(XBGp@b z=}B>IWqFD1pG{q%XP(|YSJ%WSQ6NzuQ6NzuQ6NzuQ6NzuQ6N#^|3d*ad`x@_p*$Xk z^NINTu@m3%W%89MkSLHSkSLHSkSLHSkSLHSkSLHSkSLHSkSOp!sDNn+vBrPwzYXC3 z|I@$!-@GWq@4#=t*THANYoG&ef~(*|;LWFmcpZEcTn6t0zj;!KFM<-d44whMf3FZ< z15I!ptbj}4BKX@ALi`c@3j7Fs6MP=r12*V`G`I@>`5qyD20jM<^==`43Vs4!16gnx zTml!tU*9FfFTpRs&%sy0m%*37#{q#Sz@OiVIKZF455X6}=fGz{9b5oEz97UK;M?F^ z;2Yp3cotj%1pe|4A$|b92fhow18#%&gA3pvZx`YZ;QQbW@M+KnCGa$O3JCBYti`{< zufbP<4OYR6;5v8#JP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DYL%nr>Kk+Uv$Kal)0i=!`faK5&(NWk!p@`uQK-^B(U ZJ4<&nl~TR3@;uH^v|hx1by`7-{{rlqvU>mk literal 0 HcmV?d00001 diff --git a/CMakeLists.txt b/CMakeLists.txt index f7699d1..f4319fc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,8 @@ project(lxqt-qtplugin) find_package(Qt4 4.6 REQUIRED QtCore QtGui) include(${QT_USE_FILE}) -find_package(LxQt REQUIRED) -include(${LXQT_USE_FILE}) +#find_package(LxQt REQUIRED) +#include(${LXQT_USE_FILE}) if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -Wl,-no-undefined -Wall") @@ -21,7 +21,7 @@ set(CMAKE_AUTOMOC TRUE) include_directories( ${QT_INCLUDES} - ${LXQT_INCLUDE_DIRS} + #${LXQT_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ) @@ -32,12 +32,12 @@ set(qtlxqt_SRCS qguiplatformplugin_p.h ) -add_library(qtlxqt SHARED ${qtlxqt_SRCS}) +add_library(qtrazorqt SHARED ${qtlxqt_SRCS}) -target_link_libraries(qtlxqt +target_link_libraries(qtrazorqt ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} - ${LXQT_LIBRARIES} + #${LXQT_LIBRARIES} ) -install (TARGETS qtlxqt LIBRARY DESTINATION ${QT_PLUGINS_DIR}/gui_platform) +install (TARGETS qtrazorqt LIBRARY DESTINATION ${QT_PLUGINS_DIR}/gui_platform) diff --git a/README b/README index df5c778..72f8f90 100644 --- a/README +++ b/README @@ -1,3 +1,21 @@ +razorqt-qtplugin - a fork of lxqt-qtplugin which allows you to +change icon theme in Qt4 applications in RazorQt environtment + +To compile it, invoke: +cmake ../ -DCMAKE_INSTALL_PREFIX=/usr +(in distributions defaulting Qt5 instead of Qt4 add moreover + -DQT_QMAKE_EXECUTABLE=qmake-qt4) +make install + +Bear in mind it's a minimalistic workaround. To get it working do +following steps: +1) echo "your-theme-name" >> ~/.razorqt_icontheme +"your-theme-name" could be for example " Faience-Azur +2) Add following environtment variable in RazorQt session settings: +QT_PLATFORM_PLUGIN=razorqt + + +Original lxqt-qtplugin readme: libqtlxqt - LXDE-Qt system integration plugin for Qt. With this plugin, all Qt-based programs can adopt settings of diff --git a/lxqtguiplatformplugin.cpp b/lxqtguiplatformplugin.cpp index 2c7dc31..eb8d239 100644 --- a/lxqtguiplatformplugin.cpp +++ b/lxqtguiplatformplugin.cpp @@ -31,21 +31,33 @@ #include #include #include +#include +#include Q_EXPORT_PLUGIN2(LxQtGuiPlatformPlugin, LxQtGuiPlatformPlugin) LxQtGuiPlatformPlugin::LxQtGuiPlatformPlugin() { - qDebug() << "LxQtGuiPlatformPlugin constructed"; + /*qDebug() << "LxQtGuiPlatformPlugin constructed"; connect(LxQt::Settings::globalSettings(), SIGNAL(iconThemeChanged()), SLOT(onIconThemeChanged())); - connect(LxQt::Settings::globalSettings(), SIGNAL(settingsChanged()), SLOT(onSettingsChanged())); + connect(LxQt::Settings::globalSettings(), SIGNAL(settingsChanged()), SLOT(onSettingsChanged()));*/ + QFile file(QDir::homePath() + "/.razorqt_icontheme"); + + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { + qDebug() << "Couldn't open file ~/.razorqt_icontheme. Using default icon theme!"; + iconThemeName = ""; + } + + QByteArray line = file.readLine(); + iconThemeName = line.simplified(); } LxQtGuiPlatformPlugin::~LxQtGuiPlatformPlugin() { } QString LxQtGuiPlatformPlugin::styleName() { - qDebug() << "LxQtGuiPlatformPlugin::styleName() is called"; - return "fusion"; + /*qDebug() << "LxQtGuiPlatformPlugin::styleName() is called"; + return "fusion";*/ + return QGuiPlatformPlugin::styleName(); } QPalette LxQtGuiPlatformPlugin::palette() { @@ -53,8 +65,9 @@ QPalette LxQtGuiPlatformPlugin::palette() { } QString LxQtGuiPlatformPlugin::systemIconThemeName() { - qDebug() << "LxQtGuiPlatformPlugin::systemIconThemeName() is called"; - return LxQt::Settings::globalSettings()->value("icon_theme").toString(); + /*qDebug() << "LxQtGuiPlatformPlugin::systemIconThemeName() is called"; + return LxQt::Settings::globalSettings()->value("icon_theme").toString();*/ + return iconThemeName; } /* @@ -68,7 +81,7 @@ QStringList LxQtGuiPlatformPlugin::iconThemeSearchPaths() { */ int LxQtGuiPlatformPlugin::platformHint(QGuiPlatformPlugin::PlatformHint hint) { - qDebug() << "LxQtGuiPlatformPlugin::platformHint() is called"; + //qDebug() << "LxQtGuiPlatformPlugin::platformHint() is called"; int ret = 0; switch(hint) { case PH_ToolButtonStyle: diff --git a/lxqtguiplatformplugin.h b/lxqtguiplatformplugin.h index 7da0944..43c943b 100644 --- a/lxqtguiplatformplugin.h +++ b/lxqtguiplatformplugin.h @@ -27,15 +27,18 @@ #include "qguiplatformplugin_p.h" #include -#include +//#include class LxQtGuiPlatformPlugin : public QGuiPlatformPlugin { Q_OBJECT +private: + QString iconThemeName; + public: explicit LxQtGuiPlatformPlugin(); virtual ~LxQtGuiPlatformPlugin(); - virtual QStringList keys() const { return QStringList() << QLatin1String("lxqt"); } + virtual QStringList keys() const { return QStringList() << QLatin1String("razorqt"); } virtual QString styleName(); virtual QPalette palette(); virtual QString systemIconThemeName();