projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert the Storage::HashVersion names to CamelCase
[quassel.git]
/
src
/
core
/
core.cpp
diff --git
a/src/core/core.cpp
b/src/core/core.cpp
index
b3ec48b
..
a86424f
100644
(file)
--- a/
src/core/core.cpp
+++ b/
src/core/core.cpp
@@
-1,5
+1,5
@@
/***************************************************************************
/***************************************************************************
- * Copyright (C) 2005-201
3
by the Quassel Project *
+ * Copyright (C) 2005-201
5
by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@
-32,16
+32,14
@@
#include "sqlitestorage.h"
#include "util.h"
#include "sqlitestorage.h"
#include "util.h"
-#include "protocols/legacy/legacypeer.h"
-
// migration related
#include <QFile>
// migration related
#include <QFile>
-#ifdef Q_OS_WIN
32
+#ifdef Q_OS_WIN
# include <windows.h>
#else
# include <unistd.h>
# include <termios.h>
# include <windows.h>
#else
# include <unistd.h>
# include <termios.h>
-#endif /* Q_OS_WIN
32
*/
+#endif /* Q_OS_WIN */
#ifdef HAVE_UMASK
# include <sys/types.h>
#ifdef HAVE_UMASK
# include <sys/types.h>
@@
-96,11
+94,11
@@
Core::Core()
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
// Move settings, note this does not delete the old files
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
// Move settings, note this does not delete the old files
-#ifdef Q_
W
S_MAC
+#ifdef Q_
O
S_MAC
QSettings newSettings("quassel-irc.org", "quasselcore");
#else
QSettings newSettings("quassel-irc.org", "quasselcore");
#else
-# ifdef Q_
W
S_WIN
+# ifdef Q_
O
S_WIN
QSettings::Format format = QSettings::IniFormat;
# else
QSettings::Format format = QSettings::NativeFormat;
QSettings::Format format = QSettings::IniFormat;
# else
QSettings::Format format = QSettings::NativeFormat;
@@
-108,10
+106,10
@@
Core::Core()
QString newFilePath = Quassel::configDirPath() + "quasselcore"
+ ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
QSettings newSettings(newFilePath, format);
QString newFilePath = Quassel::configDirPath() + "quasselcore"
+ ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
QSettings newSettings(newFilePath, format);
-#endif /* Q_
W
S_MAC */
+#endif /* Q_
O
S_MAC */
if (newSettings.value("Config/Version").toUInt() == 0) {
if (newSettings.value("Config/Version").toUInt() == 0) {
-# ifdef Q_
W
S_MAC
+# ifdef Q_
O
S_MAC
QString org = "quassel-irc.org";
# else
QString org = "Quassel Project";
QString org = "quassel-irc.org";
# else
QString org = "Quassel Project";
@@
-124,10
+122,10
@@
Core::Core()
newSettings.setValue("Config/Version", 1);
qWarning() << "* Your core settings have been migrated to" << newSettings.fileName();
newSettings.setValue("Config/Version", 1);
qWarning() << "* Your core settings have been migrated to" << newSettings.fileName();
-#ifndef Q_
W
S_MAC /* we don't need to move the db and cert for mac */
-#ifdef Q_OS_WIN
32
+#ifndef Q_
O
S_MAC /* we don't need to move the db and cert for mac */
+#ifdef Q_OS_WIN
QString quasselDir = qgetenv("APPDATA") + "/quassel/";
QString quasselDir = qgetenv("APPDATA") + "/quassel/";
-#elif defined Q_
W
S_MAC
+#elif defined Q_
O
S_MAC
QString quasselDir = QDir::homePath() + "/Library/Application Support/Quassel/";
#else
QString quasselDir = QDir::homePath() + "/.quassel/";
QString quasselDir = QDir::homePath() + "/Library/Application Support/Quassel/";
#else
QString quasselDir = QDir::homePath() + "/.quassel/";
@@
-155,7
+153,7
@@
Core::Core()
else
qWarning() << "!!! Moving your certificate has failed. Please move it manually into" << Quassel::configDirPath();
}
else
qWarning() << "!!! Moving your certificate has failed. Please move it manually into" << Quassel::configDirPath();
}
-#endif /* !Q_
W
S_MAC */
+#endif /* !Q_
O
S_MAC */
qWarning() << "*** Migration completed.\n\n";
}
}
qWarning() << "*** Migration completed.\n\n";
}
}
@@
-382,13
+380,10
@@
bool Core::initStorage(const QString &backend, const QVariantMap &settings, bool
return false; // trigger setup process
if (storage->setup(settings))
return initStorage(backend, settings, false);
return false; // trigger setup process
if (storage->setup(settings))
return initStorage(backend, settings, false);
- // if
setup wasn't successfull we mark the backend as unavailable
+ // if
initialization wasn't successful, we quit to keep from coming up unconfigured
case Storage::NotAvailable:
case Storage::NotAvailable:
- qCritical() << "Selected storage backend is not available:" << backend;
- storage->deleteLater();
- _storageBackends.remove(backend);
- storage = 0;
- return false;
+ qCritical() << "FATAL: Selected storage backend is not available:" << backend;
+ exit(EXIT_FAILURE);
case Storage::IsReady:
// delete all other backends
_storageBackends.remove(backend);
case Storage::IsReady:
// delete all other backends
_storageBackends.remove(backend);
@@
-937,7
+932,7
@@
QVariantMap Core::promptForSettings(const Storage *storage)
}
}
-#ifdef Q_OS_WIN
32
+#ifdef Q_OS_WIN
void Core::stdInEcho(bool on)
{
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
void Core::stdInEcho(bool on)
{
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
@@
-964,4
+959,4
@@
void Core::stdInEcho(bool on)
}
}
-#endif /* Q_OS_WIN
32
*/
+#endif /* Q_OS_WIN */