Skip to content

Commit 4271529

Browse files
committed
Modify deploy.sh
1 parent 0705181 commit 4271529

3 files changed

Lines changed: 423 additions & 101 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*.bak
12
*.deb
23
*.exe
34
*.apk

App/Main.cpp

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,33 @@ int main(int argc, char *argv[])
6565
}
6666
a.setApplicationDisplayName(w->windowTitle());
6767

68-
#ifdef RABBITCOMMON
69-
CFrmUpdater *pUpdater = new CFrmUpdater();
70-
if(pUpdater) {
71-
pUpdater->SetTitle(QImage(":/icon/AppIcon"));
72-
if(a.arguments().length() > 1) {
73-
pUpdater->GenerateUpdateJson();
74-
pUpdater->GenerateUpdateXml();
75-
return 0;
68+
#ifdef HAVE_UPDATE
69+
QSharedPointer<CFrmUpdater> pUpdater;
70+
// Check update version
71+
if(qEnvironmentVariable("SNAP").isEmpty()
72+
&& qEnvironmentVariable("FLATPAK_ID").isEmpty()) {
73+
pUpdater = QSharedPointer<CFrmUpdater>(new CFrmUpdater());
74+
if(pUpdater) {
75+
pUpdater->setAttribute(Qt::WA_DeleteOnClose, false);
76+
pUpdater->SetTitle(QImage(":/icon/AppIcon"));
77+
if(a.arguments().length() > 1) {
78+
try {
79+
pUpdater->GenerateUpdateJson();
80+
pUpdater->GenerateUpdateXml();
81+
} catch(...) {
82+
qCritical(log) << "Generate update fail";
83+
}
84+
qInfo(log) << a.applicationName() + " " + a.applicationVersion()
85+
+ " " + QObject::tr("Generate update json file End");
86+
return 0;
87+
}
88+
} else {
89+
qCritical(log) << "new CFrmUpdater() fail";
7690
}
7791
}
7892
#endif
7993

94+
8095
#if defined(BUILD_QUIWidget) && !defined(Q_OS_ANDROID)
8196
QUIWidget* quiwidget = new QUIWidget(nullptr, true);
8297
quiwidget->setMainWidget(w);

0 commit comments

Comments
 (0)