Skip to content

Commit 5e8b26f

Browse files
committed
Added a flag for turning on all custom flags
1 parent bc849a3 commit 5e8b26f

File tree

5 files changed

+28
-0
lines changed

5 files changed

+28
-0
lines changed

src/libs/installer/packagemanagercore.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2590,6 +2590,16 @@ bool PackageManagerCore::isOfflineOnly() const
25902590
return d->isOfflineOnly();
25912591
}
25922592

2593+
/*!
2594+
Returns \c true if this is our customized installer.
2595+
2596+
\sa {installer::isCustomInstaller}{installer.isCustomInstaller}
2597+
*/
2598+
bool PackageManagerCore::isCustomInstaller() const
2599+
{
2600+
return d->isCustomInstaller();
2601+
}
2602+
25932603
/*!
25942604
Returns \c true if using the custom introduction page.
25952605

src/libs/installer/packagemanagercore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ class INSTALLER_EXPORT PackageManagerCore : public QObject
225225
Q_INVOKABLE bool isOfflineOnly() const;
226226

227227
// Our additions
228+
Q_INVOKABLE bool isCustomInstaller() const;
228229
Q_INVOKABLE bool useCustomIntroductionPage() const;
229230
Q_INVOKABLE bool preloadPackages() const;
230231
Q_INVOKABLE bool noCancelButton() const;

src/libs/installer/packagemanagercore_p.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,11 @@ bool PackageManagerCorePrivate::isOfflineOnly() const
634634
return getConfigValueAsBool(QLatin1String("offlineOnly"));
635635
}
636636

637+
bool PackageManagerCorePrivate::isCustomInstaller() const
638+
{
639+
return getConfigValueAsBool(QLatin1String("customInstaller"));
640+
}
641+
637642
bool PackageManagerCorePrivate::useCustomIntroductionPage() const
638643
{
639644
return getConfigValueAsBool(QLatin1String("customIntroductionPage"));

src/libs/installer/packagemanagercore_p.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class PackageManagerCorePrivate : public QObject
8787
bool isOfflineOnly() const;
8888

8989
// Our additions
90+
bool isCustomInstaller() const;
9091
bool useCustomIntroductionPage() const;
9192
bool preloadPackages() const;
9293
bool noCancelButton() const;

tools/binarycreator/binarycreator.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,8 @@ static void printUsage()
654654
std::cout << " -f|--offline-only Forces the installer to act as an offline installer, " << std::endl;
655655
std::cout << " i.e. never access online repositories" << std::endl;
656656

657+
std::cout << " -x|--custom-installer Sets all the flags that we use for our reduced installer" << std::endl;
658+
657659
std::cout << " -xi|--custom-intro Forces the installer to use the custom introduction page" << std::endl;
658660
std::cout << " If this parameter is not given, the standard page is used" << std::endl;
659661

@@ -792,6 +794,7 @@ int main(int argc, char **argv)
792794
QStringList repositoryDirectories;
793795
bool onlineOnly = false;
794796
bool offlineOnly = false;
797+
bool customInstaller = false;
795798
bool customIntroductionPage = false;
796799
bool preloadPackages = false;
797800
bool noCancelButton = false;
@@ -856,6 +859,12 @@ int main(int argc, char **argv)
856859
onlineOnly = true;
857860
} else if (*it == QLatin1String("-f") || *it == QLatin1String("--offline-only")) {
858861
offlineOnly = true;
862+
} else if (*it == QLatin1String("-x") || *it == QLatin1String("--custom-installer")) {
863+
customInstaller = true;
864+
customIntroductionPage = true;
865+
preloadPackages = true;
866+
noCancelButton = true;
867+
noDetails = true;
859868
} else if (*it == QLatin1String("-xi") || *it == QLatin1String("--custom-intro")) {
860869
customIntroductionPage = true;
861870
} else if (*it == QLatin1String("-xp") || *it == QLatin1String("--preload-packages")) {
@@ -1005,6 +1014,8 @@ int main(int argc, char **argv)
10051014
if (onlineOnly)
10061015
offlineOnly = !onlineOnly;
10071016
confInternal.setValue(QLatin1String("offlineOnly"), offlineOnly);
1017+
// assume regular installer if --custom-installer not set
1018+
confInternal.setValue(QLatin1String("customInstaller"), customInstaller);
10081019
// assume standard introduction page if --custom-intro not set
10091020
confInternal.setValue(QLatin1String("customIntroductionPage"), customIntroductionPage);
10101021
// assume no preloading if --preload-packages not set

0 commit comments

Comments
 (0)