From d18f20669671991825230fe956acd472cca999fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Fri, 4 Feb 2011 22:41:49 +0100 Subject: Cleaned up some unused code. diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index e2d46c5..5952629 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -22,6 +22,7 @@ vars.Add(BoolVariable("warnings", "Compile with warnings turned on", "yes" if os.name != "nt" else "no")) vars.Add(BoolVariable("max_jobs", "Build with maximum number of parallel jobs", "no")) vars.Add(EnumVariable("target", "Choose a target platform for compilation", "native", ["native", "iphone-simulator", "iphone-device", "xcode"])) +vars.Add(BoolVariable("swift_mobile", "Build mobile Swift", "no")) if os.name != "nt" : vars.Add(BoolVariable("coverage", "Compile with coverage information", "no")) if os.name == "posix" : diff --git a/Swift/QtUI/QtLoginWindow.cpp b/Swift/QtUI/QtLoginWindow.cpp index 42a8f49..7d17f88 100644 --- a/Swift/QtUI/QtLoginWindow.cpp +++ b/Swift/QtUI/QtLoginWindow.cpp @@ -197,17 +197,6 @@ void QtLoginWindow::handleUIEvent(boost::shared_ptr event) { } } -/** - * Move and resize the window, but respect minimum sizes. - * (Like QWidget::setGeometry, only that will truncate the window - * the setGeometry docs say that it shouldn't do this, but I've just seen it - * maybe we can remove this method if that's a Qt bug (or I'm misusing it)). - */ -void QtLoginWindow::setGentleGeometry(const QRect& rect) { - resize(rect.size()); - move(rect.topLeft()); -} - void QtLoginWindow::selectUser(const String& username) { for (int i = 0; i < usernames_.count(); i++) { if (P2QSTRING(username) == usernames_[i]) { @@ -218,18 +207,6 @@ void QtLoginWindow::selectUser(const String& username) { } } -QRect QtLoginWindow::defaultPosition() { - QDesktopWidget desktop; - int windowWidth = 200; - int windowHeight = 500; - QRect screen = desktop.screenGeometry(-1); //appear on default screen - windowWidth = std::min(windowWidth, screen.width()); - windowHeight = std::min(windowHeight, screen.height()); - int left = (screen.width() - windowWidth) / 2; - int height = (screen.height() - windowHeight) / 2; - return QRect(left, height, windowWidth, windowHeight); -} - void QtLoginWindow::addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate) { QString username = P2QSTRING(defaultJID); int index = -1; diff --git a/Swift/QtUI/QtLoginWindow.h b/Swift/QtUI/QtLoginWindow.h index d535ed4..454b9ba 100644 --- a/Swift/QtUI/QtLoginWindow.h +++ b/Swift/QtUI/QtLoginWindow.h @@ -36,8 +36,6 @@ namespace Swift { virtual void addAvailableAccount(const String& defaultJID, const String& defaultPassword, const String& defaultCertificate); virtual void setLoginAutomatically(bool loginAutomatically); virtual void setIsLoggingIn(bool loggingIn); - static QRect defaultPosition(); - void setGentleGeometry(const QRect&); void selectUser(const String& user); bool askUserToTrustCertificatePermanently(const String& message, Certificate::ref certificate); void hide(); diff --git a/Swift/QtUI/QtUIFactory.cpp b/Swift/QtUI/QtUIFactory.cpp index 953d658..35dc4ea 100644 --- a/Swift/QtUI/QtUIFactory.cpp +++ b/Swift/QtUI/QtUIFactory.cpp @@ -51,12 +51,14 @@ LoginWindow* QtUIFactory::createLoginWindow(UIEventStream* eventStream) { } connect(systemTray, SIGNAL(clicked()), loginWindow, SLOT(bringToFront())); +#ifndef SWIFT_MOBILE QVariant loginWindowGeometryVariant = settings->getQSettings()->value("loginWindowGeometry"); if (loginWindowGeometryVariant.isValid()) { loginWindow->restoreGeometry(loginWindowGeometryVariant.toByteArray()); } connect(loginWindow, SIGNAL(geometryChanged()), this, SLOT(handleLoginWindowGeometryChanged())); if (startMinimized) loginWindow->hide(); +#endif return loginWindow; } diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index 05555f6..b16fb7d 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -38,6 +38,8 @@ myenv.MergeFlags(env.get("EXPAT_FLAGS", "")) if myenv.get("HAVE_GROWL", False) : myenv.MergeFlags(myenv["GROWL_FLAGS"]) myenv.Append(CPPDEFINES = ["HAVE_GROWL"]) +if myenv["swift_mobile"] : + myenv.Append(CPPDEFINES = ["SWIFT_MOBILE"]) if myenv.get("HAVE_SNARL", False) : myenv.MergeFlags(myenv["SNARL_FLAGS"]) myenv.Append(CPPDEFINES = ["HAVE_SNARL"]) -- cgit v0.10.2-6-g49f6