NOISSUE dissolve util library
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
#include "MultiMC.h"
|
||||
|
||||
#include <java/JavaVersionList.h>
|
||||
#include <pathutils.h>
|
||||
#include <FileSystem.h>
|
||||
|
||||
InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::InstanceSettingsPage), m_instance(inst)
|
||||
@ -186,7 +186,7 @@ void InstanceSettingsPage::on_javaDetectBtn_clicked()
|
||||
void InstanceSettingsPage::on_javaBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_path = QFileDialog::getOpenFileName(this, tr("Find Java executable"));
|
||||
QString cooked_path = NormalizePath(raw_path);
|
||||
QString cooked_path = FS::NormalizePath(raw_path);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if(cooked_path.isEmpty())
|
||||
|
@ -19,14 +19,13 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include <pathutils.h>
|
||||
|
||||
#include "dialogs/VersionSelectDialog.h"
|
||||
#include "dialogs/ProgressDialog.h"
|
||||
#include "dialogs/ModEditDialogCommon.h"
|
||||
#include "minecraft/ModList.h"
|
||||
#include "minecraft/LegacyInstance.h"
|
||||
#include "Env.h"
|
||||
#include <FileSystem.h>
|
||||
#include "MultiMC.h"
|
||||
#include <GuiUtil.h>
|
||||
|
||||
@ -147,7 +146,7 @@ void LegacyJarModPage::on_rmJarBtn_clicked()
|
||||
|
||||
void LegacyJarModPage::on_viewJarBtn_clicked()
|
||||
{
|
||||
openDirInDefaultProgram(m_inst->jarModsDir(), true);
|
||||
FS::openDirInDefaultProgram(m_inst->jarModsDir(), true);
|
||||
}
|
||||
|
||||
void LegacyJarModPage::jarCurrent(QModelIndex current, QModelIndex previous)
|
||||
|
@ -22,8 +22,6 @@
|
||||
#include <QDesktopServices>
|
||||
#include <QAbstractItemModel>
|
||||
|
||||
#include <pathutils.h>
|
||||
|
||||
#include "MultiMC.h"
|
||||
#include "dialogs/CustomMessageBox.h"
|
||||
#include "dialogs/ModEditDialogCommon.h"
|
||||
@ -31,6 +29,7 @@
|
||||
#include "minecraft/ModList.h"
|
||||
#include "minecraft/Mod.h"
|
||||
#include "minecraft/VersionFilterData.h"
|
||||
#include <FileSystem.h>
|
||||
|
||||
ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr<ModList> mods, QString id,
|
||||
QString iconName, QString displayName, QString helpPage,
|
||||
@ -163,7 +162,7 @@ void ModFolderPage::on_rmModBtn_clicked()
|
||||
|
||||
void ModFolderPage::on_viewModBtn_clicked()
|
||||
{
|
||||
openDirInDefaultProgram(m_mods->dir().absolutePath(), true);
|
||||
FS::openDirInDefaultProgram(m_mods->dir().absolutePath(), true);
|
||||
}
|
||||
|
||||
void ModFolderPage::modCurrent(const QModelIndex ¤t, const QModelIndex &previous)
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "GuiUtil.h"
|
||||
#include "RecursiveFileSystemWatcher.h"
|
||||
#include <GZip.h>
|
||||
#include <pathutils.h>
|
||||
#include <FileSystem.h>
|
||||
|
||||
OtherLogsPage::OtherLogsPage(QString path, IPathMatcher::Ptr fileFilter, QWidget *parent)
|
||||
: QWidget(parent), ui(new Ui::OtherLogsPage), m_path(path), m_fileFilter(fileFilter),
|
||||
@ -83,7 +83,7 @@ void OtherLogsPage::on_selectLogBox_currentIndexChanged(const int index)
|
||||
file = ui->selectLogBox->itemText(index);
|
||||
}
|
||||
|
||||
if (file.isEmpty() || !QFile::exists(PathCombine(m_path, file)))
|
||||
if (file.isEmpty() || !QFile::exists(FS::PathCombine(m_path, file)))
|
||||
{
|
||||
m_currentFile = QString();
|
||||
ui->text->clear();
|
||||
@ -104,7 +104,7 @@ void OtherLogsPage::on_btnReload_clicked()
|
||||
setControlsEnabled(false);
|
||||
return;
|
||||
}
|
||||
QFile file(PathCombine(m_path, m_currentFile));
|
||||
QFile file(FS::PathCombine(m_path, m_currentFile));
|
||||
if (!file.open(QFile::ReadOnly))
|
||||
{
|
||||
setControlsEnabled(false);
|
||||
@ -174,7 +174,7 @@ void OtherLogsPage::on_btnDelete_clicked()
|
||||
{
|
||||
return;
|
||||
}
|
||||
QFile file(PathCombine(m_path, m_currentFile));
|
||||
QFile file(FS::PathCombine(m_path, m_currentFile));
|
||||
if (!file.remove())
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"), tr("Unable to delete %1: %2")
|
||||
@ -215,7 +215,7 @@ void OtherLogsPage::on_btnClean_clicked()
|
||||
QStringList failed;
|
||||
for(auto item: toDelete)
|
||||
{
|
||||
QFile file(PathCombine(m_path, item));
|
||||
QFile file(FS::PathCombine(m_path, item));
|
||||
if (!file.remove())
|
||||
{
|
||||
failed.push_back(item);
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include <QDesktopServices>
|
||||
#include <QKeyEvent>
|
||||
|
||||
#include <pathutils.h>
|
||||
#include <MultiMC.h>
|
||||
|
||||
#include "dialogs/ProgressDialog.h"
|
||||
@ -26,6 +25,7 @@
|
||||
#include "tasks/SequentialTask.h"
|
||||
|
||||
#include "RWStorage.h"
|
||||
#include <FileSystem.h>
|
||||
|
||||
typedef RWStorage<QString, QIcon> SharedIconCache;
|
||||
typedef std::shared_ptr<SharedIconCache> SharedIconCachePtr;
|
||||
@ -219,7 +219,7 @@ ScreenshotsPage::ScreenshotsPage(QString path, QWidget *parent)
|
||||
m_model->setNameFilters({"*.png"});
|
||||
m_model->setNameFilterDisables(false);
|
||||
m_folder = path;
|
||||
m_valid = ensureFolderPathExists(m_folder);
|
||||
m_valid = FS::ensureFolderPathExists(m_folder);
|
||||
|
||||
ui->setupUi(this);
|
||||
ui->tabWidget->tabBar()->hide();
|
||||
@ -271,12 +271,12 @@ void ScreenshotsPage::onItemActivated(QModelIndex index)
|
||||
return;
|
||||
auto info = m_model->fileInfo(index);
|
||||
QString fileName = info.absoluteFilePath();
|
||||
openFileInDefaultProgram(info.absoluteFilePath());
|
||||
FS::openFileInDefaultProgram(info.absoluteFilePath());
|
||||
}
|
||||
|
||||
void ScreenshotsPage::on_viewFolderBtn_clicked()
|
||||
{
|
||||
openDirInDefaultProgram(m_folder, true);
|
||||
FS::openDirInDefaultProgram(m_folder, true);
|
||||
}
|
||||
|
||||
void ScreenshotsPage::on_uploadBtn_clicked()
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
#include "MultiMC.h"
|
||||
|
||||
#include <pathutils.h>
|
||||
#include <QMessageBox>
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "WorldListPage.h"
|
||||
#include "ui_WorldListPage.h"
|
||||
#include "minecraft/WorldList.h"
|
||||
#include <FileSystem.h>
|
||||
#include "dialogs/ModEditDialogCommon.h"
|
||||
#include <QEvent>
|
||||
#include <QKeyEvent>
|
||||
@ -122,7 +123,7 @@ void WorldListPage::on_rmWorldBtn_clicked()
|
||||
|
||||
void WorldListPage::on_viewFolderBtn_clicked()
|
||||
{
|
||||
openDirInDefaultProgram(m_worlds->dir().absolutePath(), true);
|
||||
FS::openDirInDefaultProgram(m_worlds->dir().absolutePath(), true);
|
||||
}
|
||||
|
||||
QModelIndex WorldListPage::getSelectedWorld()
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "minecraft/OneSixInstance.h"
|
||||
#include "BasePage.h"
|
||||
#include <MultiMC.h>
|
||||
#include <pathutils.h>
|
||||
|
||||
class WorldList;
|
||||
namespace Ui
|
||||
|
@ -20,10 +20,9 @@
|
||||
#include <QFileDialog>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <pathutils.h>
|
||||
|
||||
#include "settings/SettingsObject.h"
|
||||
#include "tools/BaseProfiler.h"
|
||||
#include <FileSystem.h>
|
||||
#include "MultiMC.h"
|
||||
|
||||
ExternalToolsPage::ExternalToolsPage(QWidget *parent) :
|
||||
@ -91,7 +90,7 @@ void ExternalToolsPage::on_jprofilerPathBtn_clicked()
|
||||
{
|
||||
break;
|
||||
}
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
if (!MMC->profilers()["jprofiler"]->check(cooked_dir, &error))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
@ -130,7 +129,7 @@ void ExternalToolsPage::on_jvisualvmPathBtn_clicked()
|
||||
{
|
||||
break;
|
||||
}
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
if (!MMC->profilers()["jvisualvm"]->check(cooked_dir, &error))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
@ -174,7 +173,7 @@ void ExternalToolsPage::on_mceditPathBtn_clicked()
|
||||
{
|
||||
break;
|
||||
}
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
if (!MMC->tools()["mcedit"]->check(cooked_dir, &error))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Error"),
|
||||
@ -213,7 +212,7 @@ void ExternalToolsPage::on_jsonEditorBrowseBtn_clicked()
|
||||
? QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation).first()
|
||||
#endif
|
||||
: ui->jsonEditorTextBox->text());
|
||||
QString cooked_file = NormalizePath(raw_file);
|
||||
QString cooked_file = FS::NormalizePath(raw_file);
|
||||
|
||||
if (cooked_file.isEmpty())
|
||||
{
|
||||
|
@ -21,8 +21,6 @@
|
||||
#include <QMessageBox>
|
||||
#include <QDir>
|
||||
|
||||
#include <pathutils.h>
|
||||
|
||||
#include "dialogs/VersionSelectDialog.h"
|
||||
#include <ColumnResizer.h>
|
||||
|
||||
@ -30,6 +28,7 @@
|
||||
#include "java/JavaVersionList.h"
|
||||
|
||||
#include "settings/SettingsObject.h"
|
||||
#include <FileSystem.h>
|
||||
#include "MultiMC.h"
|
||||
|
||||
JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
|
||||
@ -109,7 +108,7 @@ void JavaPage::on_javaDetectBtn_clicked()
|
||||
void JavaPage::on_javaBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_path = QFileDialog::getOpenFileName(this, tr("Find Java executable"));
|
||||
QString cooked_path = NormalizePath(raw_path);
|
||||
QString cooked_path = FS::NormalizePath(raw_path);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if(cooked_path.isEmpty())
|
||||
|
@ -19,8 +19,6 @@
|
||||
#include <QMessageBox>
|
||||
#include <QDir>
|
||||
|
||||
#include <pathutils.h>
|
||||
|
||||
#include "settings/SettingsObject.h"
|
||||
#include "MultiMC.h"
|
||||
|
||||
|
@ -21,11 +21,11 @@
|
||||
#include <QDir>
|
||||
#include <QTextCharFormat>
|
||||
|
||||
#include <pathutils.h>
|
||||
#include <ColumnResizer.h>
|
||||
#include "updater/UpdateChecker.h"
|
||||
|
||||
#include "settings/SettingsObject.h"
|
||||
#include <FileSystem.h>
|
||||
#include "MultiMC.h"
|
||||
|
||||
// FIXME: possibly move elsewhere
|
||||
@ -85,7 +85,7 @@ void MultiMCPage::on_ftbLauncherBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("FTB Launcher Directory"),
|
||||
ui->ftbLauncherBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
@ -97,7 +97,7 @@ void MultiMCPage::on_ftbBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir =
|
||||
QFileDialog::getExistingDirectory(this, tr("FTB Directory"), ui->ftbBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
@ -110,12 +110,12 @@ void MultiMCPage::on_instDirBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Directory"),
|
||||
ui->instDirTextBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
{
|
||||
if (checkProblemticPathJava(QDir(cooked_dir)))
|
||||
if (FS::checkProblemticPathJava(QDir(cooked_dir)))
|
||||
{
|
||||
QMessageBox warning;
|
||||
warning.setText(tr("You're trying to specify an instance folder which\'s path "
|
||||
@ -143,7 +143,7 @@ void MultiMCPage::on_iconsDirBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Icons Directory"),
|
||||
ui->iconsDirTextBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
@ -155,7 +155,7 @@ void MultiMCPage::on_modsDirBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Mods Directory"),
|
||||
ui->modsDirTextBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
@ -167,7 +167,7 @@ void MultiMCPage::on_lwjglDirBrowseBtn_clicked()
|
||||
{
|
||||
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("LWJGL Directory"),
|
||||
ui->lwjglDirTextBox->text());
|
||||
QString cooked_dir = NormalizePath(raw_dir);
|
||||
QString cooked_dir = FS::NormalizePath(raw_dir);
|
||||
|
||||
// do not allow current dir - it's dirty. Do not allow dirs that don't exist
|
||||
if (!cooked_dir.isEmpty() && QDir(cooked_dir).exists())
|
||||
@ -308,8 +308,8 @@ void MultiMCPage::applySettings()
|
||||
|
||||
// FTB
|
||||
s->set("TrackFTBInstances", ui->trackFtbBox->isChecked());
|
||||
s->set("FTBLauncherLocal", NormalizePath(ui->ftbLauncherBox->text()));
|
||||
s->set("FTBRoot", NormalizePath(ui->ftbBox->text()));
|
||||
s->set("FTBLauncherLocal", FS::NormalizePath(ui->ftbLauncherBox->text()));
|
||||
s->set("FTBRoot", FS::NormalizePath(ui->ftbBox->text()));
|
||||
|
||||
// Folders
|
||||
// TODO: Offer to move instances to new instance folder.
|
||||
|
@ -20,8 +20,6 @@
|
||||
#include <QFileDialog>
|
||||
#include <QStandardPaths>
|
||||
|
||||
#include <pathutils.h>
|
||||
|
||||
#include "settings/SettingsObject.h"
|
||||
#include "tools/BaseProfiler.h"
|
||||
#include "MultiMC.h"
|
||||
|
Reference in New Issue
Block a user