2023-02-07 12:35:06 +05:30
|
|
|
// SPDX-FileCopyrightText: 2022 Rachel Powers <508861+Ryex@users.noreply.github.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Prism Launcher - Minecraft Launcher
|
|
|
|
* Copyright (C) 2022 Rachel Powers <508861+Ryex@users.noreply.github.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
|
|
|
#include <QApplication>
|
2023-03-21 05:08:40 +05:30
|
|
|
#include <QDataStream>
|
|
|
|
#include <QDateTime>
|
2023-02-07 12:35:06 +05:30
|
|
|
#include <QDebug>
|
|
|
|
#include <QFlag>
|
|
|
|
#include <QIcon>
|
2023-02-08 14:05:03 +05:30
|
|
|
#include <QLocalSocket>
|
2023-03-21 05:08:40 +05:30
|
|
|
#include <QUrl>
|
|
|
|
#include <memory>
|
2023-02-08 14:05:03 +05:30
|
|
|
|
|
|
|
#define PRISM_EXTERNAL_EXE
|
|
|
|
#include "FileSystem.h"
|
2023-02-07 12:35:06 +05:30
|
|
|
|
2023-03-21 05:08:40 +05:30
|
|
|
class FileLinkApp : public QCoreApplication {
|
2023-02-07 12:35:06 +05:30
|
|
|
// friends for the purpose of limiting access to deprecated stuff
|
|
|
|
Q_OBJECT
|
2023-03-21 05:08:40 +05:30
|
|
|
public:
|
|
|
|
FileLinkApp(int& argc, char** argv);
|
2023-02-07 12:35:06 +05:30
|
|
|
virtual ~FileLinkApp();
|
|
|
|
|
2023-03-21 05:08:40 +05:30
|
|
|
private:
|
2023-02-08 14:05:03 +05:30
|
|
|
void joinServer(QString server);
|
|
|
|
void readPathPairs();
|
|
|
|
void runLink();
|
2023-02-09 02:06:15 +05:30
|
|
|
void sendResults();
|
|
|
|
|
|
|
|
bool m_useHardLinks = false;
|
2023-02-08 14:05:03 +05:30
|
|
|
|
2023-02-07 12:35:06 +05:30
|
|
|
QDateTime m_startTime;
|
2023-02-08 14:05:03 +05:30
|
|
|
QLocalSocket socket;
|
|
|
|
QDataStream in;
|
|
|
|
quint32 blockSize;
|
|
|
|
|
2023-02-09 02:06:15 +05:30
|
|
|
QList<FS::LinkPair> m_links_to_make;
|
|
|
|
QList<FS::LinkResult> m_path_results;
|
2023-02-07 12:35:06 +05:30
|
|
|
|
|
|
|
#if defined Q_OS_WIN32
|
|
|
|
// used on Windows to attach the standard IO streams
|
|
|
|
bool consoleAttached = false;
|
|
|
|
#endif
|
|
|
|
};
|