|
7 | 7 | */ |
8 | 8 |
|
9 | 9 | #include <cstdlib> |
10 | | -#include <filesystem> |
11 | | -#include <fstream> |
12 | 10 | #include <iostream> |
13 | 11 | #include <string> |
14 | 12 |
|
|
47 | 45 | #include <windows.h> |
48 | 46 | #else |
49 | 47 | #include <unistd.h> |
| 48 | +// Needed for saving the desktop file |
| 49 | +#include <filesystem> |
| 50 | +#include <fstream> |
50 | 51 | #endif |
51 | 52 |
|
52 | 53 | #if defined(__linux__) |
@@ -101,8 +102,9 @@ You can also load projects, build and execute them: |
101 | 102 | )"; |
102 | 103 |
|
103 | 104 | auto static createDesktopMenuItem(const std::string &programName, const std::string &version, |
104 | | - const std::string &execPath, const std::string &svgIconContent) |
105 | | - -> std::string { |
| 105 | + const std::string &execPath, |
| 106 | + const std::string &svgIconContent) -> std::string { |
| 107 | +#if !defined(_WIN32) |
106 | 108 | const char *homeDir = std::getenv("HOME"); |
107 | 109 | if (!homeDir) { |
108 | 110 | std::cerr << "Unable to get HOME directory" << std::endl; |
@@ -145,6 +147,14 @@ auto static createDesktopMenuItem(const std::string &programName, const std::str |
145 | 147 | << "Terminal=false\n"; |
146 | 148 | file.close(); |
147 | 149 | return desktopFile.string(); |
| 150 | +#else |
| 151 | + // all this does not make sence on Windows |
| 152 | + Q_UNUSED(programName) |
| 153 | + Q_UNUSED(version) |
| 154 | + Q_UNUSED(execPath) |
| 155 | + Q_UNUSED(svgIconContent) |
| 156 | + return {}; |
| 157 | +#endif |
148 | 158 | } |
149 | 159 |
|
150 | 160 | auto static getExecutablePath() -> std::string { |
@@ -540,10 +550,9 @@ void HelpPlugin::actionAbout_triggered() { |
540 | 550 |
|
541 | 551 | auto contentWidget = new QWidget; |
542 | 552 | auto contentLayout = new QVBoxLayout(contentWidget); |
543 | | - auto textLabel = new QLabel(aboutText.arg(appName) |
544 | | - .arg(version) |
545 | | - .arg("https://github.com/codepointerapp/codepointer") |
546 | | - .arg("https://gitlab.com/codepointer/codepointer")); |
| 553 | + auto textLabel = |
| 554 | + new QLabel(aboutText.arg(appName, version, "https://github.com/codepointerapp/codepointer", |
| 555 | + "https://gitlab.com/codepointer/codepointer")); |
547 | 556 | textLabel->setWordWrap(true); |
548 | 557 | textLabel->setOpenExternalLinks(true); |
549 | 558 | textLabel->setTextFormat(Qt::RichText); |
|
0 commit comments