Massive re-organization.

This commit is contained in:
Andrew 2013-02-26 16:47:39 -06:00
parent bd64cda672
commit 36396f7c6a
53 changed files with 223 additions and 185 deletions

View File

@ -61,15 +61,15 @@ add_subdirectory(launcher)
# Add the util library. # Add the util library.
add_subdirectory(libutil) add_subdirectory(libutil)
include_directories(${LIBMMCUTIL_INCLUDE_DIR}) include_directories(${LIBUTIL_INCLUDE_DIR})
# Add the settings library. # Add the settings library.
add_subdirectory(libsettings) add_subdirectory(libsettings)
include_directories(${LIBMMCSETTINGS_INCLUDE_DIR}) include_directories(${LIBSETTINGS_INCLUDE_DIR})
# Add the instance library. # Add the instance library.
add_subdirectory(libinstance) add_subdirectory(libmultimc)
include_directories(${LIBMMCINST_INCLUDE_DIR}) include_directories(${LIBMULTIMC_INCLUDE_DIR})
# Add the stdinstance plugin. # Add the stdinstance plugin.
add_subdirectory(plugins/stdinstance) add_subdirectory(plugins/stdinstance)
@ -150,7 +150,7 @@ MESSAGE(STATUS "Job URL: ${MultiMC_JOB_URL}")
######## Configure header ######## ######## Configure header ########
configure_file("${PROJECT_SOURCE_DIR}/config.h.in" configure_file("${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h") "${PROJECT_BINARY_DIR}/include/config.h")
################################ FILES ################################ ################################ FILES ################################
@ -167,14 +167,6 @@ gui/browserdialog.h
gui/aboutdialog.h gui/aboutdialog.h
gui/consolewindow.h gui/consolewindow.h
data/version.h
data/userinfo.h
data/loginresponse.h
data/appsettings.h
data/minecraftprocess.h
data/plugin/pluginmanager.h
multimc_pragma.h multimc_pragma.h
java/annotations.h java/annotations.h
@ -184,10 +176,6 @@ java/javaendian.h
java/errors.h java/errors.h
java/javautils.h java/javautils.h
java/membuffer.h java/membuffer.h
tasks/task.h
tasks/logintask.h
tasks/gameupdatetask.h
) )
@ -195,14 +183,6 @@ tasks/gameupdatetask.h
SET(MULTIMC_SOURCES SET(MULTIMC_SOURCES
main.cpp main.cpp
data/version.cpp
data/userinfo.cpp
data/loginresponse.cpp
data/appsettings.cpp
data/plugin/pluginmanager.cpp
data/minecraftprocess.cpp
gui/mainwindow.cpp gui/mainwindow.cpp
gui/modeditwindow.cpp gui/modeditwindow.cpp
gui/settingsdialog.cpp gui/settingsdialog.cpp
@ -215,10 +195,6 @@ gui/consolewindow.cpp
java/javautils.cpp java/javautils.cpp
java/annotations.cpp java/annotations.cpp
tasks/task.cpp
tasks/logintask.cpp
tasks/gameupdatetask.cpp
) )
@ -272,9 +248,9 @@ ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32
# Link # Link
QT5_USE_MODULES(MultiMC Widgets Network WebKitWidgets) QT5_USE_MODULES(MultiMC Widgets Network WebKitWidgets)
TARGET_LINK_LIBRARIES(MultiMC quazip patchlib TARGET_LINK_LIBRARIES(MultiMC quazip patchlib
libmmcutil libmmcsettings libmmcinst libUtil libSettings libMultiMC
${MultiMC_LINK_ADDITIONAL_LIBS}) ${MultiMC_LINK_ADDITIONAL_LIBS})
ADD_DEPENDENCIES(MultiMC MultiMCLauncher libmmcutil libmmcsettings libmmcinst) ADD_DEPENDENCIES(MultiMC MultiMCLauncher libUtil libSettings libMultiMC)
################################ INSTALLATION AND PACKAGING ################################ ################################ INSTALLATION AND PACKAGING ################################

View File

@ -41,10 +41,10 @@
#include "gui/aboutdialog.h" #include "gui/aboutdialog.h"
#include "instancelist.h" #include "instancelist.h"
#include "data/appsettings.h" #include "appsettings.h"
#include "data/version.h" #include "version.h"
#include "tasks/logintask.h" #include "logintask.h"
// Opens the given file in the default application. // Opens the given file in the default application.
// TODO: Move this somewhere. // TODO: Move this somewhere.

View File

@ -19,7 +19,7 @@
#include <QMainWindow> #include <QMainWindow>
#include "instancelist.h" #include "instancelist.h"
#include "data/loginresponse.h" #include "loginresponse.h"
namespace Ui namespace Ui
{ {

View File

@ -16,7 +16,7 @@
#include "settingsdialog.h" #include "settingsdialog.h"
#include "ui_settingsdialog.h" #include "ui_settingsdialog.h"
#include "data/appsettings.h" #include "appsettings.h"
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>

View File

@ -18,7 +18,7 @@
#include <QKeyEvent> #include <QKeyEvent>
#include "tasks/task.h" #include "task.h"
TaskDialog::TaskDialog(QWidget *parent) : TaskDialog::TaskDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),

View File

@ -1,47 +0,0 @@
project(libmmcinst)
set(CMAKE_AUTOMOC ON)
# Find Qt
find_package(Qt5Core REQUIRED)
# Include Qt headers.
include_directories(${Qt5Base_INCLUDE_DIRS})
include_directories(${Qt5Network_INCLUDE_DIRS})
# Include utility library.
include_directories(${CMAKE_SOURCE_DIR}/libutil/include)
# Include utility library.
include_directories(${CMAKE_SOURCE_DIR}/libsettings/include)
SET(LIBINST_HEADERS
include/libinstance_config.h
include/instancetypeinterface.h
include/instance.h
include/instancelist.h
include/instanceloader.h
include/instversion.h
include/instversionlist.h
)
SET(LIBINST_SOURCES
src/instance.cpp
src/instancelist.cpp
src/instanceloader.cpp
src/instversion.cpp
src/instversionlist.cpp
)
# Set the include dir path.
SET(LIBMMCINST_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
add_definitions(-DLIBMMCINST_LIBRARY)
add_library(libmmcinst SHARED ${LIBINST_SOURCES} ${LIBINST_HEADERS})
qt5_use_modules(libmmcinst Core)
target_link_libraries(libmmcinst libmmcutil libmmcsettings)

96
libmultimc/CMakeLists.txt Normal file
View File

@ -0,0 +1,96 @@
project(libMultiMC)
set(CMAKE_AUTOMOC ON)
# Find Qt
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
# Include Qt headers.
include_directories(${Qt5Base_INCLUDE_DIRS})
include_directories(${Qt5Network_INCLUDE_DIRS})
# Include utility library.
include_directories(${CMAKE_SOURCE_DIR}/libutil/include)
# Include settings library.
include_directories(${CMAKE_SOURCE_DIR}/libsettings/include)
SET(LIBINST_HEADERS
include/libmmc_config.h
# Instance Stuff
include/instance.h
include/instancelist.h
include/instanceloader.h
include/instversion.h
include/instversionlist.h
# Plugin Stuff
include/pluginmanager.h
include/instancetypeinterface.h
# Tasks
include/task.h
include/logintask.h
include/gameupdatetask.h
# Login Data
include/userinfo.h
include/loginresponse.h
# Misc Data
include/version.h
include/appsettings.h
include/minecraftprocess.h
)
SET(LIBINST_SOURCES
# Instance Stuff
src/instance.cpp
src/instancelist.cpp
src/instanceloader.cpp
src/instversion.cpp
src/instversionlist.cpp
# Plugin Stuff
src/pluginmanager.cpp
# Tasks
src/task.cpp
src/logintask.cpp
src/gameupdatetask.cpp
# Login Data
src/userinfo.cpp
src/loginresponse.cpp
# Misc Data
src/version.cpp
src/appsettings.cpp
src/minecraftprocess.cpp
)
# Set the include dir path.
SET(LIBMULTIMC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
# Include self.
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR}/include)
add_definitions(-DLIBMULTIMC_LIBRARY)
add_library(libMultiMC SHARED ${LIBINST_SOURCES} ${LIBINST_HEADERS})
qt5_use_modules(libMultiMC Core Network)
target_link_libraries(libMultiMC libUtil libSettings)

View File

@ -20,7 +20,9 @@
#include <basicsettingsobject.h> #include <basicsettingsobject.h>
class AppSettings : public BasicSettingsObject #include "libmmc_config.h"
class LIBMULTIMC_EXPORT AppSettings : public BasicSettingsObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,13 +18,15 @@
#include <QObject> #include <QObject>
#include <data/loginresponse.h> #include "loginresponse.h"
#include "libmmc_config.h"
/*! /*!
* \brief The game update task is the task that handles downloading instances. * \brief The game update task is the task that handles downloading instances.
* Each instance type has its own class inheriting from this base game update task. * Each instance type has its own class inheriting from this base game update task.
*/ */
class GameUpdateTask : public QObject class LIBMULTIMC_EXPORT GameUpdateTask : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -23,7 +23,7 @@
#include "inifile.h" #include "inifile.h"
#include "libinstance_config.h" #include "libmmc_config.h"
class InstanceList; class InstanceList;
@ -35,7 +35,7 @@ class InstanceList;
* To create a new instance type, create a new class inheriting from this class * To create a new instance type, create a new class inheriting from this class
* and implement the pure virtual functions. * and implement the pure virtual functions.
*/ */
class LIBMMCINST_EXPORT Instance : public QObject class LIBMULTIMC_EXPORT Instance : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -22,11 +22,11 @@
#include "siglist.h" #include "siglist.h"
#include "libinstance_config.h" #include "libmmc_config.h"
class Instance; class Instance;
class LIBMMCINST_EXPORT InstanceList : public QObject, public SigList< QSharedPointer<Instance> > class LIBMULTIMC_EXPORT InstanceList : public QObject, public SigList< QSharedPointer<Instance> >
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -20,7 +20,7 @@
#include <QMap> #include <QMap>
#include <QList> #include <QList>
#include "libinstance_config.h" #include "libmmc_config.h"
class InstanceTypeInterface; class InstanceTypeInterface;
class Instance; class Instance;
@ -32,7 +32,7 @@ typedef QList<const InstanceTypeInterface *> InstTypeList;
* Instance types are registered with the instance loader through its registerInstType() function. * Instance types are registered with the instance loader through its registerInstType() function.
* Creating instances is done through the InstanceLoader's createInstance() function. This function takes * Creating instances is done through the InstanceLoader's createInstance() function. This function takes
*/ */
class LIBMMCINST_EXPORT InstanceLoader : public QObject class LIBMULTIMC_EXPORT InstanceLoader : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,11 +18,11 @@
#include <QObject> #include <QObject>
#include "libinstance_config.h" #include "libmmc_config.h"
class InstVersionList; class InstVersionList;
class LIBMMCINST_EXPORT InstVersion : public QObject class LIBMULTIMC_EXPORT InstVersion : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,7 +18,7 @@
#include <QObject> #include <QObject>
#include "libinstance_config.h" #include "libmmc_config.h"
class InstVersion; class InstVersion;
@ -26,7 +26,7 @@ class InstVersion;
// the lists that keep track of the available game versions for that instance. // the lists that keep track of the available game versions for that instance.
// This list will not be loaded on startup. It will be loaded when the list's // This list will not be loaded on startup. It will be loaded when the list's
// load function is called. // load function is called.
class LIBMMCINST_EXPORT InstVersionList : public QObject class LIBMULTIMC_EXPORT InstVersionList : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,10 +18,10 @@
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#ifdef LIBMMCINST_LIBRARY #ifdef LIBMULTIMC_LIBRARY
# define LIBMMCINST_EXPORT Q_DECL_EXPORT # define LIBMULTIMC_EXPORT Q_DECL_EXPORT
#else #else
# define LIBMMCINST_EXPORT Q_DECL_IMPORT # define LIBMULTIMC_EXPORT Q_DECL_IMPORT
#endif #endif
//#endif // LIBINSTANCE_CONFIG_H //#endif // LIBINSTANCE_CONFIG_H

View File

@ -18,10 +18,12 @@
#include <QObject> #include <QObject>
#include "libmmc_config.h"
/*! /*!
* \brief The LoginResponse class represents a response received from Minecraft's login servers. * \brief The LoginResponse class represents a response received from Minecraft's login servers.
*/ */
class LoginResponse : public QObject class LIBMULTIMC_EXPORT LoginResponse : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,13 +18,15 @@
#include "task.h" #include "task.h"
#include "data/userinfo.h" #include "userinfo.h"
#include "data/loginresponse.h" #include "loginresponse.h"
#include "libmmc_config.h"
//class QNetworkAccessManager; //class QNetworkAccessManager;
class QNetworkReply; class QNetworkReply;
class LoginTask : public Task class LIBMULTIMC_EXPORT LoginTask : public Task
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -19,15 +19,15 @@
#include <QProcess> #include <QProcess>
#include "gui/consolewindow.h"
#include "instance.h" #include "instance.h"
#include "libmmc_config.h"
/** /**
* @file data/minecraftprocess.h * @file data/minecraftprocess.h
* @brief The MinecraftProcess class * @brief The MinecraftProcess class
*/ */
class MinecraftProcess : public QProcess class LIBMULTIMC_EXPORT MinecraftProcess : public QProcess
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -38,7 +38,7 @@ public:
* @param session the minecraft session id * @param session the minecraft session id
* @param console the instance console window * @param console the instance console window
*/ */
MinecraftProcess(InstancePtr inst, QString user, QString session, ConsoleWindow *console); MinecraftProcess(InstancePtr inst, QString user, QString session);
/** /**
* @brief launch minecraft * @brief launch minecraft
@ -78,7 +78,6 @@ signals:
void ended(); void ended();
protected: protected:
ConsoleWindow *m_console;
InstancePtr m_instance; InstancePtr m_instance;
QString m_user; QString m_user;
QString m_session; QString m_session;

View File

@ -20,10 +20,12 @@
#include <QList> #include <QList>
#include <QPluginLoader> #include <QPluginLoader>
#include "libmmc_config.h"
/*! /*!
* \brief This class is a singleton that manages loading plugins. * \brief This class is a singleton that manages loading plugins.
*/ */
class PluginManager : public QObject class LIBMULTIMC_EXPORT PluginManager : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -20,7 +20,9 @@
#include <QThread> #include <QThread>
#include <QString> #include <QString>
class Task : public QThread #include "libmmc_config.h"
class LIBMULTIMC_EXPORT Task : public QThread
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,7 +18,9 @@
#include <QObject> #include <QObject>
class UserInfo : public QObject #include "libmmc_config.h"
class LIBMULTIMC_EXPORT UserInfo : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,10 +18,12 @@
#include <QObject> #include <QObject>
#include "libmmc_config.h"
/*! /*!
* \brief The Version class represents a MultiMC version number. * \brief The Version class represents a MultiMC version number.
*/ */
class Version : public QObject class LIBMULTIMC_EXPORT Version : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,7 +18,7 @@
#include <setting.h> #include <setting.h>
#include <QPoint> #include <QPoint>
#include <QColor> //#include <QColor>
AppSettings::AppSettings(QObject *parent) : AppSettings::AppSettings(QObject *parent) :
BasicSettingsObject(parent) BasicSettingsObject(parent)
@ -41,9 +41,9 @@ AppSettings::AppSettings(QObject *parent) :
registerSetting(new Setting("InstanceToolbarPosition", QPoint())); registerSetting(new Setting("InstanceToolbarPosition", QPoint()));
// Console Colors // Console Colors
registerSetting(new Setting("SysMessageColor", QColor(Qt::blue))); // registerSetting(new Setting("SysMessageColor", QColor(Qt::blue)));
registerSetting(new Setting("StdOutColor", QColor(Qt::black))); // registerSetting(new Setting("StdOutColor", QColor(Qt::black)));
registerSetting(new Setting("StdErrColor", QColor(Qt::red))); // registerSetting(new Setting("StdErrColor", QColor(Qt::red)));
// Window Size // Window Size
registerSetting(new Setting("LaunchCompatMode", false)); registerSetting(new Setting("LaunchCompatMode", false));

View File

@ -20,7 +20,7 @@
#include <QDataStream> #include <QDataStream>
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
#include <QImage> //#include <QImage>
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include "instance.h" #include "instance.h"
@ -75,7 +75,7 @@ QStringList MinecraftProcess::splitArgs(QString args)
// prepare tools // prepare tools
inline void MinecraftProcess::extractIcon(InstancePtr inst, QString destination) inline void MinecraftProcess::extractIcon(InstancePtr inst, QString destination)
{ {
QImage(":/icons/instances/" + inst->iconKey()).save(destination); // QImage(":/icons/instances/" + inst->iconKey()).save(destination);
} }
inline void MinecraftProcess::extractLauncher(QString destination) inline void MinecraftProcess::extractLauncher(QString destination)
@ -90,8 +90,8 @@ void MinecraftProcess::prepare(InstancePtr inst)
} }
// constructor // constructor
MinecraftProcess::MinecraftProcess(InstancePtr inst, QString user, QString session, ConsoleWindow *console) : MinecraftProcess::MinecraftProcess(InstancePtr inst, QString user, QString session) :
m_instance(inst), m_user(user), m_session(session), m_console(console) m_instance(inst), m_user(user), m_session(session)
{ {
connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(finish(int, QProcess::ExitStatus))); connect(this, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(finish(int, QProcess::ExitStatus)));
@ -125,21 +125,21 @@ MinecraftProcess::MinecraftProcess(InstancePtr inst, QString user, QString sessi
// console window // console window
void MinecraftProcess::on_stdErr() void MinecraftProcess::on_stdErr()
{ {
if (m_console != nullptr) // if (m_console != nullptr)
m_console->write(readAllStandardError(), ConsoleWindow::ERROR); // m_console->write(readAllStandardError(), ConsoleWindow::ERROR);
} }
void MinecraftProcess::on_stdOut() void MinecraftProcess::on_stdOut()
{ {
if (m_console != nullptr) // if (m_console != nullptr)
m_console->write(readAllStandardOutput(), ConsoleWindow::DEFAULT); // m_console->write(readAllStandardOutput(), ConsoleWindow::DEFAULT);
} }
void MinecraftProcess::log(QString text) void MinecraftProcess::log(QString text)
{ {
if (m_console != nullptr) // if (m_console != nullptr)
m_console->write(text); // m_console->write(text);
else // else
qDebug(qPrintable(text)); qDebug(qPrintable(text));
} }
@ -166,8 +166,8 @@ void MinecraftProcess::finish(int code, ExitStatus status)
} }
} }
if (m_console != nullptr) // if (m_console != nullptr)
m_console->setMayClose(true); // m_console->setMayClose(true);
emit ended(); emit ended();
} }
@ -200,8 +200,8 @@ void MinecraftProcess::launch()
//TODO: error handling //TODO: error handling
} }
if(m_console != nullptr) // if(m_console != nullptr)
m_console->setMayClose(false); // m_console->setMayClose(false);
} }
void MinecraftProcess::genArgs() void MinecraftProcess::genArgs()

View File

@ -1,4 +1,4 @@
project(libmmcsettings) project(libSettings)
# Find Qt # Find Qt
find_package(Qt5Core REQUIRED) find_package(Qt5Core REQUIRED)
@ -7,12 +7,11 @@ find_package(Qt5Core REQUIRED)
include_directories(${Qt5Base_INCLUDE_DIRS}) include_directories(${Qt5Base_INCLUDE_DIRS})
include_directories(${Qt5Network_INCLUDE_DIRS}) include_directories(${Qt5Network_INCLUDE_DIRS})
# Include utils library headers.
include_directories(${CMAKE_SOURCE_DIR}/libutil/include)
SET(LIBSETTINGS_HEADERS SET(LIBSETTINGS_HEADERS
include/libsettings_config.h include/libsettings_config.h
include/inifile.h
include/settingsobject.h include/settingsobject.h
include/setting.h include/setting.h
include/overridesetting.h include/overridesetting.h
@ -22,6 +21,8 @@ include/inisettingsobject.h
) )
SET(LIBSETTINGS_SOURCES SET(LIBSETTINGS_SOURCES
src/inifile.cpp
src/settingsobject.cpp src/settingsobject.cpp
src/setting.cpp src/setting.cpp
src/overridesetting.cpp src/overridesetting.cpp
@ -31,10 +32,11 @@ src/inisettingsobject.cpp
) )
# Set the include dir path. # Set the include dir path.
SET(LIBMMCSETTINGS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) SET(LIBSETTINGS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
include_directories(${LIBSETTINGS_INCLUDE_DIR})
add_definitions(-DLIBMMCSETTINGS_LIBRARY) add_definitions(-DLIBSETTINGS_LIBRARY)
add_library(libmmcsettings SHARED ${LIBSETTINGS_SOURCES} ${LIBSETTINGS_HEADERS}) add_library(libSettings SHARED ${LIBSETTINGS_SOURCES} ${LIBSETTINGS_HEADERS})
qt5_use_modules(libmmcsettings Core) qt5_use_modules(libSettings Core)
target_link_libraries(libmmcsettings libmmcutil) target_link_libraries(libSettings)

View File

@ -26,7 +26,7 @@
/*! /*!
* \brief A settings object that stores its settings in a QSettings object. * \brief A settings object that stores its settings in a QSettings object.
*/ */
class LIBMMCSETTINGS_EXPORT BasicSettingsObject : public SettingsObject class LIBSETTINGS_EXPORT BasicSettingsObject : public SettingsObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -20,10 +20,10 @@
#include <QString> #include <QString>
#include <QVariant> #include <QVariant>
#include "libutil_config.h" #include "libsettings_config.h"
// Sectionless INI parser (for instance config files) // Sectionless INI parser (for instance config files)
class LIBMMCUTIL_EXPORT INIFile : public QMap<QString, QVariant> class LIBSETTINGS_EXPORT INIFile : public QMap<QString, QVariant>
{ {
public: public:
explicit INIFile(); explicit INIFile();

View File

@ -18,7 +18,7 @@
#include <QObject> #include <QObject>
#include <inifile.h> #include "inifile.h"
#include "settingsobject.h" #include "settingsobject.h"
@ -27,7 +27,7 @@
/*! /*!
* \brief A settings object that stores its settings in an INIFile. * \brief A settings object that stores its settings in an INIFile.
*/ */
class LIBMMCSETTINGS_EXPORT INISettingsObject : public SettingsObject class LIBSETTINGS_EXPORT INISettingsObject : public SettingsObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -18,10 +18,10 @@
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#ifdef LIBMMCSETTINGS_LIBRARY #ifdef LIBSETTINGS_LIBRARY
# define LIBMMCSETTINGS_EXPORT Q_DECL_EXPORT # define LIBSETTINGS_EXPORT Q_DECL_EXPORT
#else #else
# define LIBMMCSETTINGS_EXPORT Q_DECL_IMPORT # define LIBSETTINGS_EXPORT Q_DECL_IMPORT
#endif #endif
#endif // LIBINSTANCE_CONFIG_H #endif // LIBINSTANCE_CONFIG_H

View File

@ -28,7 +28,7 @@
* The other setting can be (and usually is) a part of a different SettingsObject * The other setting can be (and usually is) a part of a different SettingsObject
* than this one. * than this one.
*/ */
class LIBMMCSETTINGS_EXPORT OverrideSetting : public Setting class LIBSETTINGS_EXPORT OverrideSetting : public Setting
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -26,7 +26,7 @@ class SettingsObject;
/*! /*!
* *
*/ */
class LIBMMCSETTINGS_EXPORT Setting : public QObject class LIBSETTINGS_EXPORT Setting : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:

View File

@ -34,7 +34,7 @@ class Setting;
* *
* \sa Setting * \sa Setting
*/ */
class LIBMMCSETTINGS_EXPORT SettingsObject : public QObject class LIBSETTINGS_EXPORT SettingsObject : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
@ -165,6 +165,6 @@ private:
/*! /*!
* \brief A global settings object. * \brief A global settings object.
*/ */
LIBMMCSETTINGS_EXPORT extern SettingsObject *globalSettings; LIBSETTINGS_EXPORT extern SettingsObject *globalSettings;
#endif // SETTINGSOBJECT_H #endif // SETTINGSOBJECT_H

View File

@ -1,4 +1,4 @@
project(libmmcutil) project(libUtil)
######## Set compiler flags ######## ######## Set compiler flags ########
IF(APPLE) IF(APPLE)
@ -32,8 +32,6 @@ include/osutils.h
include/userutils.h include/userutils.h
include/cmdutils.h include/cmdutils.h
include/inifile.h
include/siglist.h include/siglist.h
include/siglist_impl.h include/siglist_impl.h
) )
@ -43,15 +41,13 @@ src/pathutils.cpp
src/osutils.cpp src/osutils.cpp
src/userutils.cpp src/userutils.cpp
src/cmdutils.cpp src/cmdutils.cpp
src/inifile.cpp
) )
# Set the include dir path. # Set the include dir path.
SET(LIBMMCUTIL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) SET(LIBUTIL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
add_definitions(-DLIBMMCUTIL_LIBRARY) add_definitions(-DLIBUTIL_LIBRARY)
add_library(libmmcutil SHARED ${LIBUTIL_SOURCES} ${LIBUTIL_HEADERS}) add_library(libUtil SHARED ${LIBUTIL_SOURCES} ${LIBUTIL_HEADERS})
qt5_use_modules(libmmcutil Core) qt5_use_modules(libUtil Core)
target_link_libraries(libmmcutil) target_link_libraries(libUtil)

View File

@ -42,7 +42,7 @@ namespace Commandline {
namespace FlagStyle namespace FlagStyle
{ {
enum LIBMMCUTIL_EXPORT Enum enum LIBUTIL_EXPORT Enum
{ {
GNU, /**< --option and -o (GNU Style) */ GNU, /**< --option and -o (GNU Style) */
Unix, /**< -option and -o (Unix Style) */ Unix, /**< -option and -o (Unix Style) */
@ -60,7 +60,7 @@ enum LIBMMCUTIL_EXPORT Enum
*/ */
namespace ArgumentStyle namespace ArgumentStyle
{ {
enum LIBMMCUTIL_EXPORT Enum enum LIBUTIL_EXPORT Enum
{ {
Space, /**< --option=value */ Space, /**< --option=value */
Equals, /**< --option value */ Equals, /**< --option value */
@ -75,7 +75,7 @@ enum LIBMMCUTIL_EXPORT Enum
namespace OptionType namespace OptionType
{ {
enum LIBMMCUTIL_EXPORT Enum enum LIBUTIL_EXPORT Enum
{ {
Switch, Switch,
Option Option
@ -85,7 +85,7 @@ enum LIBMMCUTIL_EXPORT Enum
/** /**
* @brief The ParsingError class * @brief The ParsingError class
*/ */
class LIBMMCUTIL_EXPORT ParsingError : public std::exception class LIBUTIL_EXPORT ParsingError : public std::exception
{ {
public: public:
ParsingError(const QString &what); ParsingError(const QString &what);
@ -100,7 +100,7 @@ private:
/** /**
* @brief The Parser class * @brief The Parser class
*/ */
class LIBMMCUTIL_EXPORT Parser class LIBUTIL_EXPORT Parser
{ {
public: public:
/** /**

View File

@ -18,10 +18,10 @@
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#ifdef LIBMMCUTIL_LIBRARY #ifdef LIBUTIL_LIBRARY
# define LIBMMCUTIL_EXPORT Q_DECL_EXPORT # define LIBUTIL_EXPORT Q_DECL_EXPORT
#else #else
# define LIBMMCUTIL_EXPORT Q_DECL_IMPORT # define LIBUTIL_EXPORT Q_DECL_IMPORT
#endif #endif
#endif // LIBUTIL_CONFIG_H #endif // LIBUTIL_CONFIG_H

View File

@ -20,9 +20,9 @@
#include "libutil_config.h" #include "libutil_config.h"
LIBMMCUTIL_EXPORT QString PathCombine(QString path1, QString path2); LIBUTIL_EXPORT QString PathCombine(QString path1, QString path2);
LIBMMCUTIL_EXPORT QString PathCombine(QString path1, QString path2, QString path3); LIBUTIL_EXPORT QString PathCombine(QString path1, QString path2, QString path3);
LIBMMCUTIL_EXPORT QString AbsolutePath(QString path); LIBUTIL_EXPORT QString AbsolutePath(QString path);
#endif // PATHUTILS_H #endif // PATHUTILS_H

View File

@ -8,12 +8,12 @@
namespace Util namespace Util
{ {
// Get the Directory representing the User's Desktop // Get the Directory representing the User's Desktop
LIBMMCUTIL_EXPORT QString getDesktopDir(); LIBUTIL_EXPORT QString getDesktopDir();
// Create a shortcut at *location*, pointing to *dest* called with the arguments *args* // Create a shortcut at *location*, pointing to *dest* called with the arguments *args*
// call it *name* and assign it the icon *icon* // call it *name* and assign it the icon *icon*
// return true if operation succeeded // return true if operation succeeded
LIBMMCUTIL_EXPORT bool createShortCut(QString location, QString dest, QStringList args, QString name, QString iconLocation); LIBUTIL_EXPORT bool createShortCut(QString location, QString dest, QStringList args, QString name, QString iconLocation);
} }
#endif // USERUTILS_H #endif // USERUTILS_H

View File

@ -26,13 +26,13 @@
#include "gui/taskdialog.h" #include "gui/taskdialog.h"
#include "gui/consolewindow.h" #include "gui/consolewindow.h"
#include "data/appsettings.h" #include "appsettings.h"
#include "instancelist.h" #include "instancelist.h"
#include "data/loginresponse.h" #include "loginresponse.h"
#include "tasks/logintask.h" #include "logintask.h"
#include "data/minecraftprocess.h" #include "minecraftprocess.h"
#include "data/plugin/pluginmanager.h" #include "pluginmanager.h"
#include "pathutils.h" #include "pathutils.h"
#include "cmdutils.h" #include "cmdutils.h"
@ -85,7 +85,7 @@ private slots:
{ {
// TODO: console // TODO: console
console = new ConsoleWindow(); console = new ConsoleWindow();
proc = new MinecraftProcess(instance, response.username(), response.sessionID(), console); proc = new MinecraftProcess(instance, response.username(), response.sessionID());
//if (instance->getShowConsole()) //if (instance->getShowConsole())
console->show(); console->show();
connect(proc, SIGNAL(ended()), SLOT(onTerminated())); connect(proc, SIGNAL(ended()), SLOT(onTerminated()));

View File

@ -47,7 +47,7 @@ quazip
patchlib patchlib
# Link the util, settings, and instance libraries. # Link the util, settings, and instance libraries.
libmmcutil libUtil
libmmcsettings libSettings
libmmcinst libMultiMC
) )