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

Bugfix: Client sometimes does not show up when started by a user #7784

Merged
merged 1 commit into from
Mar 4, 2020
Merged
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
5 changes: 5 additions & 0 deletions changelog/unreleased/7018
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Client sometimes does not show up when started by a user

We fixed a bug where a client somtimes does not show up when a user request a start.

https://github.com/owncloud/client/issues/7018
2 changes: 1 addition & 1 deletion mirall.desktop.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Categories=Utility;X-SuSE-SyncUtility;
Type=Application
Exec=@APPLICATION_EXECUTABLE@
Exec=@APPLICATION_EXECUTABLE@ --showsettings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why do we want to show the settings dialog when starting owncloud from the menu?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well it gives the user a feedback that something happened.
I'd also expect 99% of the users to have it in autostart.

Name=@APPLICATION_NAME@ desktop sync client
Comment=@APPLICATION_NAME@ desktop synchronization client
GenericName=Folder Sync
Expand Down
4 changes: 4 additions & 0 deletions src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ Application::Application(int &argc, char **argv)
, _userTriggeredConnect(false)
, _debugMode(false)
{
#ifdef Q_OS_LINUX
_startedAt.start();
#endif

qsrand(std::random_device()());

Expand Down Expand Up @@ -540,12 +542,14 @@ void Application::slotParseMessage(const QString &msg, QObject *)
}

} else if (msg.startsWith(QLatin1String("MSG_SHOWSETTINGS"))) {
#ifdef Q_OS_LINUX
qCInfo(lcApplication) << "Running for" << _startedAt.elapsed() / 1000.0 << "sec";
if (_startedAt.elapsed() < 10 * 1000) {
// This call is mirrored with the one in int main()
qCWarning(lcApplication) << "Ignoring MSG_SHOWSETTINGS, possibly double-invocation of client via session restore and auto start";
return;
}
#endif
showSettingsDialog();
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/gui/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ protected slots:
bool _helpOnly;
bool _versionOnly;


#ifdef Q_OS_LINUX
QElapsedTimer _startedAt;
#endif

// options from command line:
bool _showLogWindow;
Expand Down