summaryrefslogtreecommitdiffstats
path: root/qt-ui/simplewidgets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/simplewidgets.cpp')
-rw-r--r--qt-ui/simplewidgets.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index a6e01a724..ce659c6cf 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -8,6 +8,9 @@
#include <QSpinBox>
#include <QButtonGroup>
#include <QDebug>
+#include <QProcess>
+#include <QStringList>
+#include <QDebug>
#include "../dive.h"
@@ -118,3 +121,18 @@ RenumberDialog::RenumberDialog(): QDialog(), ui( new Ui::RenumberDialog())
ui->setupUi(this);
connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(buttonClicked(QAbstractButton*)));
}
+
+bool isGnome3Session()
+{
+#if defined(QT_OS_WIW) || defined(QT_OS_MAC)
+ return false;
+#else
+ if (qApp->style()->objectName() != "gtk+")
+ return false;
+ QProcess p;
+ p.start("pidof", QStringList() << "gnome-shell" );
+ p.waitForFinished(-1);
+ QString p_stdout = p.readAllStandardOutput();
+ return !p_stdout.isEmpty();
+#endif
+}