Bridge now longer derives from QObject
FossilOrigin-Name: 0017b55685a3fe99a72757e9f6a8c3c261612413
This commit is contained in:
@ -496,7 +496,7 @@ bool Bridge::runFossilRaw(const QStringList &args, QStringList *output, int *exi
|
||||
return QProcess::startDetached(fossil, args, wkdir);
|
||||
|
||||
// Make status message
|
||||
QString status_msg = tr("Running Fossil");
|
||||
QString status_msg = QObject::tr("Running Fossil");
|
||||
if(args.length() > 0)
|
||||
status_msg = QString("Fossil %0").arg(args[0].toCaseFolded());
|
||||
ScopedFossilStatus status(uiCallback, status_msg);
|
||||
@ -506,7 +506,7 @@ bool Bridge::runFossilRaw(const QStringList &args, QStringList *output, int *exi
|
||||
QTemporaryFile args_file;
|
||||
if(!args_file.open())
|
||||
{
|
||||
log(tr("Could not generate command line file"));
|
||||
log(QObject::tr("Could not generate command line file"));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -537,7 +537,7 @@ bool Bridge::runFossilRaw(const QStringList &args, QStringList *output, int *exi
|
||||
process.start(fossil, *final_args);
|
||||
if(!process.waitForStarted())
|
||||
{
|
||||
log(tr("Could not start Fossil executable '%0'").arg(fossil)+"\n");
|
||||
log(QObject::tr("Could not start Fossil executable '%0'").arg(fossil)+"\n");
|
||||
return false;
|
||||
}
|
||||
const QChar EOL_MARK('\n');
|
||||
@ -574,7 +574,7 @@ bool Bridge::runFossilRaw(const QStringList &args, QStringList *output, int *exi
|
||||
|
||||
if(abortOperation)
|
||||
{
|
||||
log("\n* "+tr("Terminated")+" *\n");
|
||||
log("\n* "+QObject::tr("Terminated")+" *\n");
|
||||
#ifdef Q_OS_WIN // Verify this is still true on Qt5
|
||||
process.kill(); // QT on windows cannot terminate console processes with QProcess::terminate
|
||||
#else
|
||||
@ -801,7 +801,7 @@ bool Bridge::startUI(const QString &httpPort)
|
||||
{
|
||||
if(uiRunning())
|
||||
{
|
||||
log(tr("Fossil UI is already running")+"\n");
|
||||
log(QObject::tr("Fossil UI is already running")+"\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -812,14 +812,14 @@ bool Bridge::startUI(const QString &httpPort)
|
||||
fossilUI.setWorkingDirectory(getCurrentWorkspace());
|
||||
|
||||
log("<b>> fossil ui</b><br>", true);
|
||||
log(tr("Starting Fossil browser UI. Please wait.")+"\n");
|
||||
log(QObject::tr("Starting Fossil browser UI. Please wait.")+"\n");
|
||||
QString fossil = getFossilPath();
|
||||
|
||||
fossilUI.start(fossil, QStringList() << "server" << "--localauth" << "-P" << httpPort );
|
||||
|
||||
if(!fossilUI.waitForStarted() || fossilUI.state()!=QProcess::Running)
|
||||
{
|
||||
log(tr("Could not start Fossil executable '%s'").arg(fossil)+"\n");
|
||||
log(QObject::tr("Could not start Fossil executable '%s'").arg(fossil)+"\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
17
src/Bridge.h
17
src/Bridge.h
@ -27,7 +27,7 @@ enum RepoStatus
|
||||
REPO_OLD_SCHEMA
|
||||
};
|
||||
|
||||
class Bridge : public QObject
|
||||
class Bridge
|
||||
{
|
||||
public:
|
||||
class UICallback
|
||||
@ -41,17 +41,16 @@ public:
|
||||
|
||||
|
||||
Bridge()
|
||||
: QObject(0)
|
||||
, abortOperation(false)
|
||||
: abortOperation(false)
|
||||
, uiCallback(0)
|
||||
{
|
||||
}
|
||||
|
||||
void Init(UICallback *callback, const QString &fossPath, const QString &workspace)
|
||||
void Init(UICallback *callback)
|
||||
{
|
||||
uiCallback = callback;
|
||||
fossilPath = fossPath;
|
||||
currentWorkspace = workspace;
|
||||
fossilPath.clear();
|
||||
currentWorkspace.clear();
|
||||
}
|
||||
|
||||
bool runFossil(const QStringList &args, QStringList *output=0, int runFlags=RUNFLAGS_NONE);
|
||||
@ -94,7 +93,8 @@ public:
|
||||
bool pushRepository();
|
||||
bool pullRepository();
|
||||
bool cloneRepository(const QString &repository, const QUrl &url, const QUrl &proxyUrl);
|
||||
|
||||
bool undoRepository(QStringList& result, bool explainOnly);
|
||||
bool updateRepository(QStringList& result, bool explainOnly);
|
||||
bool getFossilVersion(QString &version);
|
||||
|
||||
bool uiRunning() const;
|
||||
@ -108,8 +108,6 @@ public:
|
||||
bool removeFiles(const QStringList& fileList, bool deleteLocal);
|
||||
bool revertFiles(const QStringList& fileList);
|
||||
bool renameFile(const QString& beforePath, const QString& afterPath, bool renameLocal);
|
||||
bool undoRepository(QStringList& result, bool explainOnly);
|
||||
bool updateRepository(QStringList& result, bool explainOnly);
|
||||
bool getFossilSettings(QStringList& result);
|
||||
bool setFossilSetting(const QString &name, const QString &value, bool global);
|
||||
bool setRemoteUrl(const QString &url);
|
||||
@ -136,7 +134,6 @@ private:
|
||||
QString fossilPath; // The value from the settings
|
||||
QString repositoryFile;
|
||||
QString projectName;
|
||||
|
||||
QProcess fossilUI;
|
||||
};
|
||||
|
||||
|
@ -190,7 +190,7 @@ MainWindow::MainWindow(Settings &_settings, QWidget *parent, QString *workspaceP
|
||||
|
||||
uiCallback.init(this);
|
||||
// Need to be before applySettings which sets the last workspace
|
||||
bridge.Init(&uiCallback, "", "");
|
||||
bridge.Init(&uiCallback);
|
||||
|
||||
applySettings();
|
||||
|
||||
|
Reference in New Issue
Block a user