diff --git a/main.cpp b/main.cpp index 939b78f2..3f004913 100644 --- a/main.cpp +++ b/main.cpp @@ -192,7 +192,9 @@ int main(int argc, char *argv[]) qWarning().noquote() << "app startd" << "(log: " + logPath + ")"; // Desktop entry +#ifdef Q_OS_LINUX registerXdgMime(app); +#endif IPC *ipc = new IPC(&app); QStringList posArgs = parser.positionalArguments(); diff --git a/src/qt/utils.cpp b/src/qt/utils.cpp index 35b5a835..bcf69917 100644 --- a/src/qt/utils.cpp +++ b/src/qt/utils.cpp @@ -67,6 +67,7 @@ QString getAccountName(){ return accountName; } +#ifdef Q_OS_LINUX QString xdgMime(QApplication &app){ return QString( "[Desktop Entry]\n" @@ -88,7 +89,6 @@ QString xdgMime(QApplication &app){ } void registerXdgMime(QApplication &app){ -#ifdef Q_OS_LINUX // Register desktop entry // - MacOS handled via Info.plist // - Windows handled in the installer by rbrunner7 @@ -111,8 +111,8 @@ void registerXdgMime(QApplication &app){ #endif fileWrite(filePath, mime); -#endif } +#endif QString randomUserAgent(){ QStringList urand; diff --git a/src/qt/utils.h b/src/qt/utils.h index f48dff97..17fb44d9 100644 --- a/src/qt/utils.h +++ b/src/qt/utils.h @@ -37,8 +37,10 @@ bool fileExists(QString path); QByteArray fileOpen(QString path); bool fileWrite(QString path, QString data); QString getAccountName(); +#ifdef Q_OS_LINUX QString xdgMime(QApplication &app); void registerXdgMime(QApplication &app); +#endif const static QRegExp reURI = QRegExp("^\\w+:\\/\\/([\\w+\\-?\\-_\\-=\\-&]+)"); QString randomUserAgent();