53c930
Merge pull request #4920 from shun-iwasawa/fix_task_macos
@@ -135,6 +135,7 @@ public:
|
|
135
135
|
|
136
136
|
QString getCommandLinePrgName() const;
|
137
137
|
QString getCommandLineArguments() const;
|
138
|
+
QStringList getCommandLineArgumentsList() const;
|
138
139
|
QString getCommandLine(bool isFarmTask = false) const;
|
139
140
|
void parseCommandLine(QString commandLine);
|
140
141
|
|
@@ -244,17 +244,7 @@ commandline += " -id " + task->m_id;*/
|
|
244
244
|
}
|
245
245
|
|
246
246
|
process->setProgram(task->getCommandLinePrgName());
|
247
|
-
|
247
|
+
process->setArguments(task->getCommandLineArgumentsList());
|
248
|
-
process->setNativeArguments(task->getCommandLineArguments());
|
249
|
-
|
250
|
-
|
251
|
-
process->setArguments(
|
252
|
-
task->getCommandLineArguments().split(" ", Qt::SkipEmptyParts));
|
253
|
-
|
254
|
-
process->setArguments(
|
255
|
-
task->getCommandLineArguments().split(" ", QString::SkipEmptyParts));
|
256
|
-
|
257
|
-
|
258
248
|
process->start();
|
259
249
|
process->waitForFinished(-1);
|
260
250
|
|
@@ -368,8 +368,8 @@ static QString getExeName(bool isComposer) {
|
|
368
368
|
return name + ".exe ";
|
369
369
|
|
370
370
|
TVER::ToonzVersion tver;
|
371
|
-
return
|
372
|
-
|
371
|
+
return QString::fromStdString(tver.getAppName()) + ".app/Contents/MacOS/" +
|
372
|
+
name;
|
373
373
|
|
374
374
|
return name;
|
375
375
|
|
@@ -541,6 +541,59 @@ QString TFarmTask::getCommandLineArguments() const {
|
|
541
541
|
return cmdline;
|
542
542
|
}
|
543
543
|
|
544
|
+
QStringList TFarmTask::getCommandLineArgumentsList() const {
|
545
|
+
QStringList ret;
|
546
|
+
|
547
|
+
if (!m_taskFilePath.isEmpty())
|
548
|
+
ret << QString::fromStdWString(
|
549
|
+
TSystem::toUNC(m_taskFilePath).getWideString());
|
550
|
+
|
551
|
+
if (m_callerMachineName != "") {
|
552
|
+
struct hostent *he = gethostbyname(m_callerMachineName.toLatin1());
|
553
|
+
if (he) {
|
554
|
+
char *ipAddress = inet_ntoa(*(struct in_addr *)*(he->h_addr_list));
|
555
|
+
ret << "-tmsg" << QString::fromUtf8(ipAddress);
|
556
|
+
}
|
557
|
+
}
|
558
|
+
|
559
|
+
if (!m_isComposerTask) {
|
560
|
+
if (m_overwrite == Overwrite_All)
|
561
|
+
ret << "-overwriteAll";
|
562
|
+
else if (m_overwrite == Overwrite_NoPaint)
|
563
|
+
ret << "-overwriteNoPaint";
|
564
|
+
if (m_onlyVisible) ret << "-onlyvisible";
|
565
|
+
return ret;
|
566
|
+
}
|
567
|
+
|
568
|
+
if (!m_outputPath.isEmpty()) {
|
569
|
+
TFilePath outputPath;
|
570
|
+
try {
|
571
|
+
outputPath = TSystem::toUNC(m_outputPath);
|
572
|
+
} catch (TException &) {
|
573
|
+
}
|
574
|
+
|
575
|
+
ret << "-o" << QString::fromStdWString(outputPath.getWideString());
|
576
|
+
}
|
577
|
+
|
578
|
+
ret << "-range" << QString::number(m_from) << QString::number(m_to);
|
579
|
+
ret << "-step" << QString::number(m_step);
|
580
|
+
ret << "-shrink" << QString::number(m_shrink);
|
581
|
+
ret << "-multimedia" << QString::number(m_multimedia);
|
582
|
+
|
583
|
+
const QString threadCounts[3] = {"single", "half", "all"};
|
584
|
+
ret << "-nthreads" << threadCounts[m_threadsIndex];
|
585
|
+
|
586
|
+
const QString maxTileSizes[4] = {
|
587
|
+
"none", QString::number(TOutputProperties::LargeVal),
|
588
|
+
QString::number(TOutputProperties::MediumVal),
|
589
|
+
QString::number(TOutputProperties::SmallVal)};
|
590
|
+
ret << "-maxtilesize" << maxTileSizes[m_maxTileSizeIndex];
|
591
|
+
|
592
|
+
QString appname = QSettings().applicationName();
|
593
|
+
|
594
|
+
return ret;
|
595
|
+
}
|
596
|
+
|
544
597
|
QString TFarmTask::getCommandLine(bool) const {
|
545
598
|
return getCommandLinePrgName() + getCommandLineArguments();
|
546
599
|
}
|