Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sys tray icon is automatically added by QSystemTrayIcon (Fixes #357) #384

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/birdtrayapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ BirdtrayApp::BirdtrayApp(int &argc, char** argv) : QApplication(argc, argv)

Log::debug( "Birdtray version %d.%d.%d started", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH );

ensureSystemTrayAvailable();
// Load settings
settings = new Settings();
if (commandLineParser.isSet("reset-settings")) {
Expand Down Expand Up @@ -255,18 +254,3 @@ void BirdtrayApp::onSecondInstanceCommand(QLocalSocket* clientSocket) {
trayIcon->showSettings();
}
}

void BirdtrayApp::ensureSystemTrayAvailable() {
int passed = 0;
while (!QSystemTrayIcon::isSystemTrayAvailable()) {
if (passed == 0) {
qDebug("Waiting for system tray to become available");
}
passed++;
if (passed > 120) {
Log::fatal( QApplication::tr("Sorry, system tray cannot be controlled "
"through this add-on on your operating system.") );
}
QThread::msleep(500);
}
}
4 changes: 0 additions & 4 deletions src/birdtrayapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,6 @@ protected Q_SLOTS:
*/
void onSecondInstanceCommand(QLocalSocket* clientSocket);

/**
* Wait for the system tray to become available and exit if it doesn't within 60 seconds.
*/
static void ensureSystemTrayAvailable();
};


Expand Down