aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authorkumquat-ir <66188216+kumquat-ir@users.noreply.github.com>2022-07-31 14:54:50 -0400
committerkumquat-ir <66188216+kumquat-ir@users.noreply.github.com>2022-07-31 14:54:50 -0400
commit579582740e9efd5a054b02a8b0e1d8999abfa6fa (patch)
tree5b07ba3387dfebabd68e534d79f7bf7363aad67c /launcher
parent20b1723e78149c1f2ac4072cbd46997e9c5160fa (diff)
parentb15544c163ccbca08ea498b3b3a51c82d7fb3e12 (diff)
downloadPrismLauncher-579582740e9efd5a054b02a8b0e1d8999abfa6fa.tar.gz
PrismLauncher-579582740e9efd5a054b02a8b0e1d8999abfa6fa.tar.bz2
PrismLauncher-579582740e9efd5a054b02a8b0e1d8999abfa6fa.zip
Merge remote-tracking branch 'origin/develop' into download-all-blocked
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
Diffstat (limited to 'launcher')
-rw-r--r--launcher/CMakeLists.txt2
-rw-r--r--launcher/FileSystem.cpp227
-rw-r--r--launcher/FileSystem.h51
-rw-r--r--launcher/InstanceImportTask.h6
-rw-r--r--launcher/InstanceList.cpp428
-rw-r--r--launcher/InstanceList.h13
-rwxr-xr-xlauncher/Launcher.in18
-rw-r--r--launcher/MMCZip.cpp21
-rw-r--r--launcher/MMCZip.h8
-rw-r--r--launcher/QObjectPtr.h6
-rw-r--r--launcher/java/JavaUtils.cpp79
-rw-r--r--launcher/java/JavaUtils.h1
-rw-r--r--launcher/launch/LaunchTask.cpp33
-rw-r--r--launcher/launch/LaunchTask.h4
-rw-r--r--launcher/launch/steps/PostLaunchCommand.cpp7
-rw-r--r--launcher/launch/steps/PreLaunchCommand.cpp7
-rw-r--r--launcher/minecraft/MinecraftInstance.cpp6
-rw-r--r--launcher/minecraft/World.cpp8
-rw-r--r--launcher/minecraft/World.h6
-rw-r--r--launcher/minecraft/auth/AccountList.cpp11
-rw-r--r--launcher/minecraft/auth/steps/LauncherLoginStep.cpp17
-rw-r--r--launcher/minecraft/auth/steps/MinecraftProfileStep.cpp17
-rw-r--r--launcher/minecraft/auth/steps/MinecraftProfileStepMojang.cpp17
-rw-r--r--launcher/minecraft/auth/steps/XboxAuthorizationStep.cpp21
-rw-r--r--launcher/minecraft/auth/steps/XboxProfileStep.cpp17
-rw-r--r--launcher/minecraft/auth/steps/XboxUserStep.cpp13
-rw-r--r--launcher/modplatform/atlauncher/ATLPackInstallTask.h6
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.cpp7
-rw-r--r--launcher/modplatform/flame/FileResolvingTask.h3
-rw-r--r--launcher/modplatform/flame/FlameCheckUpdate.cpp4
-rw-r--r--launcher/modplatform/legacy_ftb/PackInstallTask.h6
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp279
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.h80
-rw-r--r--launcher/modplatform/modpacksch/FTBPackManifest.cpp46
-rw-r--r--launcher/modplatform/modpacksch/FTBPackManifest.h48
-rw-r--r--launcher/modplatform/technic/SingleZipPackInstallTask.h6
-rw-r--r--launcher/net/NetUtils.h44
-rw-r--r--launcher/ui/MainWindow.cpp32
-rw-r--r--launcher/ui/MainWindow.h1
-rw-r--r--launcher/ui/dialogs/ModUpdateDialog.cpp13
-rw-r--r--launcher/ui/dialogs/ProgressDialog.cpp4
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.cpp8
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.ui2
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.cpp2
-rw-r--r--launcher/ui/pages/instance/ModFolderPage.cpp15
-rw-r--r--launcher/ui/pages/modplatform/ftb/FtbPage.cpp3
-rw-r--r--launcher/ui/themes/DarkTheme.cpp1
47 files changed, 966 insertions, 688 deletions
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index cb509a00..48337bbc 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -117,6 +117,7 @@ set(NET_SOURCES
net/NetAction.h
net/NetJob.cpp
net/NetJob.h
+ net/NetUtils.h
net/PasteUpload.cpp
net/PasteUpload.h
net/Sink.h
@@ -990,7 +991,6 @@ target_link_libraries(Launcher_logic
Launcher_murmur2
nbt++
${ZLIB_LIBRARIES}
- optional-bare
tomlc99
BuildConfig
Katabasis
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp
index ebb4460d..21edbb48 100644
--- a/launcher/FileSystem.cpp
+++ b/launcher/FileSystem.cpp
@@ -35,76 +35,64 @@
#include "FileSystem.h"
+#include <QDebug>
#include <QDir>
#include <QFile>
-#include <QSaveFile>
#include <QFileInfo>
-#include <QDebug>
-#include <QUrl>
+#include <QSaveFile>
#include <QStandardPaths>
#include <QTextStream>
+#include <QUrl>
#if defined Q_OS_WIN32
- #include <windows.h>
- #include <string>
- #include <sys/utime.h>
- #include <winnls.h>
- #include <shobjidl.h>
- #include <objbase.h>
- #include <objidl.h>
- #include <shlguid.h>
- #include <shlobj.h>
+#include <objbase.h>
+#include <objidl.h>
+#include <shlguid.h>
+#include <shlobj.h>
+#include <shobjidl.h>
+#include <sys/utime.h>
+#include <windows.h>
+#include <winnls.h>
+#include <string>
#else
- #include <utime.h>
+#include <utime.h>
#endif
namespace FS {
-void ensureExists(const QDir &dir)
+void ensureExists(const QDir& dir)
{
- if (!QDir().mkpath(dir.absolutePath()))
- {
- throw FileSystemException("Unable to create folder " + dir.dirName() + " (" +
- dir.absolutePath() + ")");
+ if (!QDir().mkpath(dir.absolutePath())) {
+ throw FileSystemException("Unable to create folder " + dir.dirName() + " (" + dir.absolutePath() + ")");
}
}
-void write(const QString &filename, const QByteArray &data)
+void write(const QString& filename, const QByteArray& data)
{
ensureExists(QFileInfo(filename).dir());
QSaveFile file(filename);
- if (!file.open(QSaveFile::WriteOnly))
- {
- throw FileSystemException("Couldn't open " + filename + " for writing: " +
- file.errorString());
+ if (!file.open(QSaveFile::WriteOnly)) {
+ throw FileSystemException("Couldn't open " + filename + " for writing: " + file.errorString());
}
- if (data.size() != file.write(data))
- {
- throw FileSystemException("Error writing data to " + filename + ": " +
- file.errorString());
+ if (data.size() != file.write(data)) {
+ throw FileSystemException("Error writing data to " + filename + ": " + file.errorString());
}
- if (!file.commit())
- {
- throw FileSystemException("Error while committing data to " + filename + ": " +
- file.errorString());
+ if (!file.commit()) {
+ throw FileSystemException("Error while committing data to " + filename + ": " + file.errorString());
}
}
-QByteArray read(const QString &filename)
+QByteArray read(const QString& filename)
{
QFile file(filename);
- if (!file.open(QFile::ReadOnly))
- {
- throw FileSystemException("Unable to open " + filename + " for reading: " +
- file.errorString());
+ if (!file.open(QFile::ReadOnly)) {
+ throw FileSystemException("Unable to open " + filename + " for reading: " + file.errorString());
}
const qint64 size = file.size();
QByteArray data(int(size), 0);
const qint64 ret = file.read(data.data(), size);
- if (ret == -1 || ret != size)
- {
- throw FileSystemException("Error reading data from " + filename + ": " +
- file.errorString());
+ if (ret == -1 || ret != size) {
+ throw FileSystemException("Error reading data from " + filename + ": " + file.errorString());
}
return data;
}
@@ -138,12 +126,12 @@ bool ensureFolderPathExists(QString foldernamepath)
return success;
}
-bool copy::operator()(const QString &offset)
+bool copy::operator()(const QString& offset)
{
- //NOTE always deep copy on windows. the alternatives are too messy.
- #if defined Q_OS_WIN32
+// NOTE always deep copy on windows. the alternatives are too messy.
+#if defined Q_OS_WIN32
m_followSymlinks = true;
- #endif
+#endif
auto src = PathCombine(m_src.absolutePath(), offset);
auto dst = PathCombine(m_dst.absolutePath(), offset);
@@ -152,52 +140,39 @@ bool copy::operator()(const QString &offset)
if (!currentSrc.exists())
return false;
- if(!m_followSymlinks && currentSrc.isSymLink())
- {
+ if (!m_followSymlinks && currentSrc.isSymLink()) {
qDebug() << "creating symlink" << src << " - " << dst;
- if (!ensureFilePathExists(dst))
- {
+ if (!ensureFilePathExists(dst)) {
qWarning() << "Cannot create path!";
return false;
}
return QFile::link(currentSrc.symLinkTarget(), dst);
- }
- else if(currentSrc.isFile())
- {
+ } else if (currentSrc.isFile()) {
qDebug() << "copying file" << src << " - " << dst;
- if (!ensureFilePathExists(dst))
- {
+ if (!ensureFilePathExists(dst)) {
qWarning() << "Cannot create path!";
return false;
}
return QFile::copy(src, dst);
- }
- else if(currentSrc.isDir())
- {
+ } else if (currentSrc.isDir()) {
qDebug() << "recursing" << offset;
- if (!ensureFolderPathExists(dst))
- {
+ if (!ensureFolderPathExists(dst)) {
qWarning() << "Cannot create path!";
return false;
}
QDir currentDir(src);
- for(auto & f : currentDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System))
- {
+ for (auto& f : currentDir.entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::Hidden | QDir::System)) {
auto inner_offset = PathCombine(offset, f);
// ignore and skip stuff that matches the blacklist.
- if(m_blacklist && m_blacklist->matches(inner_offset))
- {
+ if (m_blacklist && m_blacklist->matches(inner_offset)) {
continue;
}
- if(!operator()(inner_offset))
- {
+ if (!operator()(inner_offset)) {
qWarning() << "Failed to copy" << inner_offset;
return false;
}
}
- }
- else
- {
+ } else {
qCritical() << "Copy ERROR: Unknown filesystem object:" << src;
return false;
}
@@ -208,55 +183,41 @@ bool deletePath(QString path)
{
bool OK = true;
QFileInfo finfo(path);
- if(finfo.isFile()) {
+ if (finfo.isFile()) {
return QFile::remove(path);
}
QDir dir(path);
- if (!dir.exists())
- {
+ if (!dir.exists()) {
return OK;
}
- auto allEntries = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden |
- QDir::AllDirs | QDir::Files,
- QDir::DirsFirst);
+ auto allEntries = dir.entryInfoList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst);
- for(auto & info: allEntries)
- {
+ for (auto& info : allEntries) {
#if defined Q_OS_WIN32
QString nativePath = QDir::toNativeSeparators(info.absoluteFilePath());
auto wString = nativePath.toStdWString();
DWORD dwAttrs = GetFileAttributesW(wString.c_str());
// Windows: check for junctions, reparse points and other nasty things of that sort
- if(dwAttrs & FILE_ATTRIBUTE_REPARSE_POINT)
- {
- if (info.isFile())
- {
+ if (dwAttrs & FILE_ATTRIBUTE_REPARSE_POINT) {
+ if (info.isFile()) {
OK &= QFile::remove(info.absoluteFilePath());
- }
- else if (info.isDir())
- {
+ } else if (info.isDir()) {
OK &= dir.rmdir(info.absoluteFilePath());
}
}
#else
// We do not trust Qt with reparse points, but do trust it with unix symlinks.
- if(info.isSymLink())
- {
+ if (info.isSymLink()) {
OK &= QFile::remove(info.absoluteFilePath());
}
#endif
- else if (info.isDir())
- {
+ else if (info.isDir()) {
OK &= deletePath(info.absoluteFilePath());
- }
- else if (info.isFile())
- {
+ } else if (info.isFile()) {
OK &= QFile::remove(info.absoluteFilePath());
- }
- else
- {
+ } else {
OK = false;
qCritical() << "Delete ERROR: Unknown filesystem object:" << info.absoluteFilePath();
}
@@ -265,22 +226,30 @@ bool deletePath(QString path)
return OK;
}
+bool trash(QString path, QString *pathInTrash = nullptr)
+{
+#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
+ return false;
+#else
+ return QFile::moveToTrash(path, pathInTrash);
+#endif
+}
-QString PathCombine(const QString & path1, const QString & path2)
+QString PathCombine(const QString& path1, const QString& path2)
{
- if(!path1.size())
+ if (!path1.size())
return path2;
- if(!path2.size())
+ if (!path2.size())
return path1;
return QDir::cleanPath(path1 + QDir::separator() + path2);
}
-QString PathCombine(const QString & path1, const QString & path2, const QString & path3)
+QString PathCombine(const QString& path1, const QString& path2, const QString& path3)
{
return PathCombine(PathCombine(path1, path2), path3);
}
-QString PathCombine(const QString & path1, const QString & path2, const QString & path3, const QString & path4)
+QString PathCombine(const QString& path1, const QString& path2, const QString& path3, const QString& path4)
{
return PathCombine(PathCombine(path1, path2, path3), path4);
}
@@ -292,17 +261,14 @@ QString AbsolutePath(QString path)
QString ResolveExecutable(QString path)
{
- if (path.isEmpty())
- {
+ if (path.isEmpty()) {
return QString();
}
- if(!path.contains('/'))
- {
+ if (!path.contains('/')) {
path = QStandardPaths::findExecutable(path);
}
QFileInfo pathInfo(path);
- if(!pathInfo.exists() || !pathInfo.isExecutable())
- {
+ if (!pathInfo.exists() || !pathInfo.isExecutable()) {
return QString();
}
return pathInfo.absoluteFilePath();
@@ -322,12 +288,9 @@ QString NormalizePath(QString path)
QDir b(path);
QString newAbsolute = b.absolutePath();
- if (newAbsolute.startsWith(currentAbsolute))
- {
+ if (newAbsolute.startsWith(currentAbsolute)) {
return a.relativeFilePath(newAbsolute);
- }
- else
- {
+ } else {
return newAbsolute;
}
}
@@ -336,10 +299,8 @@ QString badFilenameChars = "\"\\/?<>:;*|!+\r\n";
QString RemoveInvalidFilenameChars(QString string, QChar replaceWith)
{
- for (int i = 0; i < string.length(); i++)
- {
- if (badFilenameChars.contains(string[i]))
- {
+ for (int i = 0; i < string.length(); i++) {
+ if (badFilenameChars.contains(string[i])) {
string[i] = replaceWith;
}
}
@@ -351,15 +312,12 @@ QString DirNameFromString(QString string, QString inDir)
int num = 0;
QString baseName = RemoveInvalidFilenameChars(string, '-');
QString dirName;
- do
- {
- if(num == 0)
- {
+ do {
+ if (num == 0) {
dirName = baseName;
- }
- else
- {
- dirName = baseName + QString::number(num);;
+ } else {
+ dirName = baseName + QString::number(num);
+ ;
}
// If it's over 9000
@@ -383,36 +341,31 @@ bool checkProblemticPathJava(QDir folder)
bool called_coinit = false;
-HRESULT CreateLink(LPCSTR linkPath, LPCSTR targetPath, LPCSTR args)
+HRESULT CreateLink(LPCCH linkPath, LPCWSTR targetPath, LPCWSTR args)
{
HRESULT hres;
- if (!called_coinit)
- {
+ if (!called_coinit) {
hres = CoInitialize(NULL);
called_coinit = true;
- if (!SUCCEEDED(hres))
- {
+ if (!SUCCEEDED(hres)) {
qWarning("Failed to initialize COM. Error 0x%08lX", hres);
return hres;
}
}
- IShellLinkA *link;
- hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink,
- (LPVOID *)&link);
+ IShellLink* link;
+ hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID*)&link);
- if (SUCCEEDED(hres))
- {
- IPersistFile *persistFile;
+ if (SUCCEEDED(hres)) {
+ IPersistFile* persistFile;
link->SetPath(targetPath);
link->SetArguments(args);
- hres = link->QueryInterface(IID_IPersistFile, (LPVOID *)&persistFile);
- if (SUCCEEDED(hres))
- {
+ hres = link->QueryInterface(IID_IPersistFile, (LPVOID*)&persistFile);
+ if (SUCCEEDED(hres)) {
WCHAR wstr[MAX_PATH];
MultiByteToWideChar(CP_ACP, 0, linkPath, -1, wstr, MAX_PATH);
@@ -433,8 +386,7 @@ QString getDesktopDir()
}
// Cross-platform Shortcut creation
-bool createShortCut(QString location, QString dest, QStringList args, QString name,
- QString icon)
+bool createShortCut(QString location, QString dest, QStringList args, QString name, QString icon)
{
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD)
location = PathCombine(location, name + ".desktop");
@@ -459,8 +411,7 @@ bool createShortCut(QString location, QString dest, QStringList args, QString na
stream.flush();
f.close();
- f.setPermissions(f.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeGroup |
- QFileDevice::ExeOther);
+ f.setPermissions(f.permissions() | QFileDevice::ExeOwner | QFileDevice::ExeGroup | QFileDevice::ExeOther);
return true;
#elif defined Q_OS_WIN
diff --git a/launcher/FileSystem.h b/launcher/FileSystem.h
index fd305b01..b46f3281 100644
--- a/launcher/FileSystem.h
+++ b/launcher/FileSystem.h
@@ -41,29 +41,27 @@
#include <QDir>
#include <QFlags>
-namespace FS
-{
+namespace FS {
-class FileSystemException : public ::Exception
-{
-public:
- FileSystemException(const QString &message) : Exception(message) {}
+class FileSystemException : public ::Exception {
+ public:
+ FileSystemException(const QString& message) : Exception(message) {}
};
/**
* write data to a file safely
*/
-void write(const QString &filename, const QByteArray &data);
+void write(const QString& filename, const QByteArray& data);
/**
* read data from a file safely\
*/
-QByteArray read(const QString &filename);
+QByteArray read(const QString& filename);
/**
* Update the last changed timestamp of an existing file
*/
-bool updateTimestamp(const QString & filename);
+bool updateTimestamp(const QString& filename);
/**
* Creates all the folders in a path for the specified path
@@ -77,35 +75,31 @@ bool ensureFilePathExists(QString filenamepath);
*/
bool ensureFolderPathExists(QString filenamepath);
-class copy
-{
-public:
- copy(const QString & src, const QString & dst)
+class copy {
+ public:
+ copy(const QString& src, const QString& dst)
{
m_src.setPath(src);
m_dst.setPath(dst);
}
- copy & followSymlinks(const bool follow)
+ copy& followSymlinks(const bool follow)
{
m_followSymlinks = follow;
return *this;
}
- copy & blacklist(const IPathMatcher * filter)
+ copy& blacklist(const IPathMatcher* filter)
{
m_blacklist = filter;
return *this;
}
- bool operator()()
- {
- return operator()(QString());
- }
+ bool operator()() { return operator()(QString()); }
-private:
- bool operator()(const QString &offset);
+ private:
+ bool operator()(const QString& offset);
-private:
+ private:
bool m_followSymlinks = true;
- const IPathMatcher * m_blacklist = nullptr;
+ const IPathMatcher* m_blacklist = nullptr;
QDir m_src;
QDir m_dst;
};
@@ -115,9 +109,14 @@ private:
*/
bool deletePath(QString path);
-QString PathCombine(const QString &path1, const QString &path2);
-QString PathCombine(const QString &path1, const QString &path2, const QString &path3);
-QString PathCombine(const QString &path1, const QString &path2, const QString &path3, const QString &path4);
+/**
+ * Trash a folder / file
+ */
+bool trash(QString path, QString *pathInTrash);
+
+QString PathCombine(const QString& path1, const QString& path2);
+QString PathCombine(const QString& path1, const QString& path2, const QString& path3);
+QString PathCombine(const QString& path1, const QString& path2, const QString& path3, const QString& path4);
QString AbsolutePath(QString path);
diff --git a/launcher/InstanceImportTask.h b/launcher/InstanceImportTask.h
index b67d48f3..48ba2161 100644
--- a/launcher/InstanceImportTask.h
+++ b/launcher/InstanceImportTask.h
@@ -44,7 +44,7 @@
#include "QObjectPtr.h"
#include "modplatform/flame/PackManifest.h"
-#include <nonstd/optional>
+#include <optional>
class QuaZip;
namespace Flame
@@ -90,8 +90,8 @@ private: /* data */
QString m_archivePath;
bool m_downloadRequired = false;
std::unique_ptr<QuaZip> m_packZip;
- QFuture<nonstd::optional<QStringList>> m_extractFuture;
- QFutureWatcher<nonstd::optional<QStringList>> m_extractFutureWatcher;
+ QFuture<std::optional<QStringList>> m_extractFuture;
+ QFutureWatcher<std::optional<QStringList>> m_extractFutureWatcher;
QVector<Flame::File> m_blockedMods;
enum class ModpackType{
Unknown,
diff --git a/launcher/InstanceList.cpp b/launcher/InstanceList.cpp
index fb7103dd..4447a17c 100644
--- a/launcher/InstanceList.cpp
+++ b/launcher/InstanceList.cpp
@@ -33,30 +33,32 @@
* limitations under the License.
*/
+#include <QDebug>
#include <QDir>
#include <QDirIterator>
-#include <QSet>
#include <QFile>
-#include <QThread>
-#include <QTextStream>
-#include <QXmlStreamReader>
-#include <QTimer>
-#include <QDebug>
#include <QFileSystemWatcher>
-#include <QUuid>
#include <QJsonArray>
#include <QJsonDocument>
#include <QMimeData>
+#include <QSet>
+#include <QStack>
+#include <QPair>
+#include <QTextStream>
+#include <QThread>
+#include <QTimer>
+#include <QUuid>
+#include <QXmlStreamReader>
-#include "InstanceList.h"
#include "BaseInstance.h"
+#include "ExponentialSeries.h"
+#include "FileSystem.h"
+#include "InstanceList.h"
#include "InstanceTask.h"
-#include "settings/INISettingsObject.h"
#include "NullInstance.h"
-#include "minecraft/MinecraftInstance.h"
-#include "FileSystem.h"
-#include "ExponentialSeries.h"
#include "WatchLock.h"
+#include "minecraft/MinecraftInstance.h"
+#include "settings/INISettingsObject.h"
#ifdef Q_OS_WIN32
#include <Windows.h>
@@ -64,13 +66,12 @@
const static int GROUP_FILE_FORMAT_VERSION = 1;
-InstanceList::InstanceList(SettingsObjectPtr settings, const QString & instDir, QObject *parent)
+InstanceList::InstanceList(SettingsObjectPtr settings, const QString& instDir, QObject* parent)
: QAbstractListModel(parent), m_globalSettings(settings)
{
resumeWatch();
// Create aand normalize path
- if (!QDir::current().exists(instDir))
- {
+ if (!QDir::current().exists(instDir)) {
QDir::current().mkpath(instDir);
}
@@ -83,9 +84,7 @@ InstanceList::InstanceList(SettingsObjectPtr settings, const QString & instDir,
m_watcher->addPath(m_instDir);
}
-InstanceList::~InstanceList()
-{
-}
+InstanceList::~InstanceList() {}
Qt::DropActions InstanceList::supportedDragActions() const
{
@@ -99,7 +98,7 @@ Qt::DropActions InstanceList::supportedDropActions() const
bool InstanceList::canDropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) const
{
- if(data && data->hasFormat("application/x-instanceid")) {
+ if (data && data->hasFormat("application/x-instanceid")) {
return true;
}
return false;
@@ -107,7 +106,7 @@ bool InstanceList::canDropMimeData(const QMimeData* data, Qt::DropAction action,
bool InstanceList::dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent)