rename twitchaccount file to twitchuser to match class name

This commit is contained in:
Rasmus Karlsson 2017-05-30 15:22:44 +02:00
parent 980e71ab40
commit 548fbe5866
10 changed files with 64 additions and 7 deletions

2
.gitignore vendored
View file

@ -42,3 +42,5 @@ moc_*.cpp
# Ignore binary file # Ignore binary file
/chatterino /chatterino
settings.json

View file

@ -1,7 +1,7 @@
#ifndef ACCOUNTMANAGER_H #ifndef ACCOUNTMANAGER_H
#define ACCOUNTMANAGER_H #define ACCOUNTMANAGER_H
#include "twitch/twitchaccount.h" #include "twitch/twitchuser.h"
#include <mutex> #include <mutex>
#include <vector> #include <vector>

View file

@ -84,7 +84,7 @@ SOURCES += main.cpp\
widgets/titlebar.cpp \ widgets/titlebar.cpp \
appdatapath.cpp \ appdatapath.cpp \
accountmanager.cpp \ accountmanager.cpp \
twitch/twitchaccount.cpp \ twitch/twitchuser.cpp \
ircaccount.cpp \ ircaccount.cpp \
widgets/accountpopup.cpp widgets/accountpopup.cpp
@ -142,7 +142,7 @@ HEADERS += \
widgets/titlebar.h \ widgets/titlebar.h \
appdatapath.h \ appdatapath.h \
accountmanager.h \ accountmanager.h \
twitch/twitchaccount.h \ twitch/twitchuser.h \
ircaccount.h \ ircaccount.h \
widgets/accountpopup.h \ widgets/accountpopup.h \
util/distancebetweenpoints.h util/distancebetweenpoints.h
@ -159,6 +159,12 @@ win32 {
INCLUDEPATH += C:\local\boost\ INCLUDEPATH += C:\local\boost\
} }
# Include settings library
SOURCES += lib/settings/src/settings/settingdata.cpp
SOURCES += lib/settings/src/settings/settingmanager.cpp
INCLUDEPATH += lib/settings/include/
INCLUDEPATH += lib/settings/external/signals/include/
# Optional dependency on windows sdk 7.1 # Optional dependency on windows sdk 7.1
win32:exists(C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\Windows.h) { win32:exists(C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\Windows.h) {
LIBS += -L"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib" \ LIBS += -L"C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib" \

View file

@ -22,6 +22,7 @@ private:
QString _realName; QString _realName;
QString _password; QString _password;
}; };
} // namespace chatterino } // namespace chatterino
#endif // IRCUSER_H #endif // IRCUSER_H

View file

@ -4,9 +4,9 @@
#include "channel.h" #include "channel.h"
#include "channelmanager.h" #include "channelmanager.h"
#include "messages/messageparseargs.h" #include "messages/messageparseargs.h"
#include "twitch/twitchaccount.h"
#include "twitch/twitchmessagebuilder.h" #include "twitch/twitchmessagebuilder.h"
#include "twitch/twitchparsemessage.h" #include "twitch/twitchparsemessage.h"
#include "twitch/twitchuser.h"
#include <irccommand.h> #include <irccommand.h>
#include <ircconnection.h> #include <ircconnection.h>

View file

@ -4,7 +4,7 @@
#define TWITCH_MAX_MESSAGELENGTH 500 #define TWITCH_MAX_MESSAGELENGTH 500
#include "messages/message.h" #include "messages/message.h"
#include "twitch/twitchaccount.h" #include "twitch/twitchuser.h"
#include <IrcMessage> #include <IrcMessage>
#include <QMap> #include <QMap>

View file

@ -15,14 +15,59 @@
#include <QDir> #include <QDir>
#include <QStandardPaths> #include <QStandardPaths>
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
#include <pajlada/settings/settingmanager.hpp>
using namespace chatterino; using namespace chatterino;
using namespace chatterino::widgets; using namespace chatterino::widgets;
namespace {
inline bool initSettings(bool portable)
{
QString settingsPath;
if (portable) {
settingsPath.append(QDir::currentPath());
} else {
// Get settings path
settingsPath.append(QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation));
if (settingsPath.isEmpty()) {
printf("Error finding writable location for settings\n");
return false;
}
}
if (!QDir().mkpath(settingsPath)) {
printf("Error creating directories for settings: %s\n", qPrintable(settingsPath));
return false;
}
settingsPath.append("/settings.json");
pajlada::Settings::SettingManager::load(qPrintable(settingsPath));
return true;
}
} // namespace
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication a(argc, argv); QApplication a(argc, argv);
// Options
bool portable = false;
for (int i = 1; i < argc; ++i) {
if (strcmp(argv[i], "portable") == 0) {
portable = true;
}
}
// Initialize settings
if (!initSettings(portable)) {
printf("Error initializing settings\n");
return 1;
}
chatterino::logging::init(); chatterino::logging::init();
SettingsManager::getInstance().load(); SettingsManager::getInstance().load();
Resources::load(); Resources::load();
@ -42,6 +87,9 @@ int main(int argc, char *argv[])
SettingsManager::getInstance().save(); SettingsManager::getInstance().save();
// Save settings
pajlada::Settings::SettingManager::save();
WindowManager::getInstance().save(); WindowManager::getInstance().save();
return ret; return ret;

View file

@ -1,4 +1,4 @@
#include "twitchaccount.h" #include "twitchuser.h"
namespace chatterino { namespace chatterino {
namespace twitch { namespace twitch {

View file

@ -1,6 +1,6 @@
#include "widgets/settingsdialog.h" #include "widgets/settingsdialog.h"
#include "accountmanager.h" #include "accountmanager.h"
#include "twitch/twitchaccount.h" #include "twitch/twitchuser.h"
#include "widgets/settingsdialogtab.h" #include "widgets/settingsdialogtab.h"
#include "windowmanager.h" #include "windowmanager.h"