[Pkg-owncloud-commits] [owncloud-client] 174/332: Utility: move raiseDisalog to owncloudGui
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:56 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 7dd926d4f1942ad18caecfff1c34ee516e29db31
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Mon Jul 7 15:20:37 2014 +0200
Utility: move raiseDisalog to owncloudGui
Reduce the GUI dependency in the Utility namespace used by libowncloudsync
---
src/mirall/accountsettings.cpp | 2 +-
src/mirall/owncloudgui.cpp | 14 ++++++++++++--
src/mirall/owncloudgui.h | 2 ++
src/mirall/utility.cpp | 13 -------------
src/mirall/utility.h | 1 -
5 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/src/mirall/accountsettings.cpp b/src/mirall/accountsettings.cpp
index 89a99e5..6259d44 100644
--- a/src/mirall/accountsettings.cpp
+++ b/src/mirall/accountsettings.cpp
@@ -719,7 +719,7 @@ void AccountSettings::slotIgnoreFilesEditor()
_ignoreEditor->setAttribute( Qt::WA_DeleteOnClose, true );
_ignoreEditor->open();
} else {
- Utility::raiseDialog(_ignoreEditor);
+ ownCloudGui::raiseDialog(_ignoreEditor);
}
}
diff --git a/src/mirall/owncloudgui.cpp b/src/mirall/owncloudgui.cpp
index 89d3dec..001be58 100644
--- a/src/mirall/owncloudgui.cpp
+++ b/src/mirall/owncloudgui.cpp
@@ -482,7 +482,7 @@ void ownCloudGui::slotShowSettings()
_settingsDialog->show();
}
_settingsDialog->setGeneralErrors( _startupFails );
- Utility::raiseDialog(_settingsDialog.data());
+ raiseDialog(_settingsDialog.data());
}
void ownCloudGui::slotShowSyncProtocol()
@@ -510,7 +510,7 @@ void ownCloudGui::slotToggleLogBrowser()
if (_logBrowser->isVisible() ) {
_logBrowser->hide();
} else {
- Utility::raiseDialog(_logBrowser);
+ raiseDialog(_logBrowser);
}
}
@@ -526,5 +526,15 @@ void ownCloudGui::slotHelp()
QDesktopServices::openUrl(QUrl(Theme::instance()->helpUrl()));
}
+void ownCloudGui::raiseDialog( QWidget *raiseWidget )
+{
+ if( raiseWidget && raiseWidget->parentWidget() == 0) {
+ // Qt has a bug which causes parent-less dialogs to pop-under.
+ raiseWidget->showNormal();
+ raiseWidget->raise();
+ raiseWidget->activateWindow();
+ }
+}
+
} // end namespace
diff --git a/src/mirall/owncloudgui.h b/src/mirall/owncloudgui.h
index 2b238e9..c67e43c 100644
--- a/src/mirall/owncloudgui.h
+++ b/src/mirall/owncloudgui.h
@@ -43,6 +43,8 @@ public:
bool checkAccountExists(bool openSettings);
+ static void raiseDialog(QWidget *raiseWidget);
+
signals:
void setupProxy();
diff --git a/src/mirall/utility.cpp b/src/mirall/utility.cpp
index f6c3c4b..497376a 100644
--- a/src/mirall/utility.cpp
+++ b/src/mirall/utility.cpp
@@ -23,7 +23,6 @@
#include <QFile>
#include <QUrl>
#ifndef TOKEN_AUTH_ONLY
-#include <QWidget>
#include <QDesktopServices>
#endif
#include <QDebug>
@@ -164,18 +163,6 @@ QByteArray Utility::userAgentString()
.toLatin1();
}
-void Utility::raiseDialog( QWidget *raiseWidget )
-{
-#ifndef TOKEN_AUTH_ONLY
- if( raiseWidget && raiseWidget->parentWidget() == 0) {
- // Qt has a bug which causes parent-less dialogs to pop-under.
- raiseWidget->showNormal();
- raiseWidget->raise();
- raiseWidget->activateWindow();
- }
-#endif
-}
-
bool Utility::hasLaunchOnStartup(const QString &appName)
{
return hasLaunchOnStartup_private(appName);
diff --git a/src/mirall/utility.h b/src/mirall/utility.h
index e439751..0ff9ac9 100644
--- a/src/mirall/utility.h
+++ b/src/mirall/utility.h
@@ -36,7 +36,6 @@ namespace Utility
OWNCLOUDSYNC_EXPORT QString octetsToString( qint64 octets );
OWNCLOUDSYNC_EXPORT QString platform();
OWNCLOUDSYNC_EXPORT QByteArray userAgentString();
- OWNCLOUDSYNC_EXPORT void raiseDialog(QWidget *);
OWNCLOUDSYNC_EXPORT bool hasLaunchOnStartup(const QString &appName);
OWNCLOUDSYNC_EXPORT void setLaunchOnStartup(const QString &appName, const QString& guiName, bool launch);
OWNCLOUDSYNC_EXPORT qint64 freeDiskSpace(const QString &path, bool *ok = 0);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list