Skip to content

Commit 9999710

Browse files
committed
Merge branch 'release/2.0.9'
2 parents 308d9ec + efc9dbe commit 9999710

File tree

4 files changed

+40
-9
lines changed

4 files changed

+40
-9
lines changed

MiniZincIDE/CHANGES

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
?
1+
2015-12-07
2+
v2.0.9
3+
- Remove (unimplemented) menu item for adding files to a project.
4+
- Fix version number comparison to work for multi-digit minor and patch
5+
versions.
6+
2015-10-19
27
v2.0.8
38
- Only disable the run and compile actions when a solving process is currently
49
running (keep editor and rest of the user interface enabled).

MiniZincIDE/MiniZincIDE.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
1111
TARGET = MiniZincIDE
1212
TEMPLATE = app
1313

14-
VERSION = 2.0.8
14+
VERSION = 2.0.9
1515
DEFINES += MINIZINC_IDE_VERSION=\\\"$$VERSION\\\"
1616

1717
bundled {

MiniZincIDE/mainwindow.cpp

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,39 @@ void
519519
IDE::versionCheckFinished(void) {
520520
if (versionCheckReply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt()==200) {
521521
QString currentVersion = versionCheckReply->readAll();
522-
if (currentVersion > applicationVersion()) {
522+
523+
QRegExp versionRegExp("([1-9][0-9]+)\\.([0-9]+)\\.([0-9]+)");
524+
525+
int curVersionMajor = 0;
526+
int curVersionMinor = 0;
527+
int curVersionPatch = 0;
528+
bool ok = true;
529+
if (versionRegExp.indexIn(currentVersion) != -1) {
530+
curVersionMajor = versionRegExp.cap(1).toInt(&ok);
531+
if (ok)
532+
curVersionMinor = versionRegExp.cap(2).toInt(&ok);
533+
if (ok)
534+
curVersionPatch = versionRegExp.cap(3).toInt(&ok);
535+
}
536+
537+
int appVersionMajor = 0;
538+
int appVersionMinor = 0;
539+
int appVersionPatch = 0;
540+
if (ok && versionRegExp.indexIn(applicationVersion()) != -1) {
541+
appVersionMajor = versionRegExp.cap(1).toInt(&ok);
542+
if (ok)
543+
appVersionMinor = versionRegExp.cap(2).toInt(&ok);
544+
if (ok)
545+
appVersionPatch = versionRegExp.cap(3).toInt(&ok);
546+
}
547+
548+
bool needUpdate = ok && (curVersionMajor > appVersionMajor ||
549+
(curVersionMajor==appVersionMajor &&
550+
(curVersionMinor > appVersionMinor ||
551+
(curVersionMinor==appVersionMinor &&
552+
curVersionPatch > appVersionPatch))));
553+
554+
if (needUpdate) {
523555
int button = QMessageBox::information(NULL,"Update available",
524556
"Version "+currentVersion+" of the MiniZinc IDE is now available. "
525557
"You are currently using version "+applicationVersion()+

MiniZincIDE/mainwindow.ui

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,6 @@
591591
<addaction name="actionNewModel_file"/>
592592
<addaction name="actionNewData_file"/>
593593
<addaction name="actionOpen"/>
594-
<addaction name="actionAdd_to_project"/>
595594
<addaction name="menuRecent_Files"/>
596595
<addaction name="menuRecent_Projects"/>
597596
<addaction name="separator"/>
@@ -1268,11 +1267,6 @@
12681267
<bool>false</bool>
12691268
</property>
12701269
</action>
1271-
<action name="actionAdd_to_project">
1272-
<property name="text">
1273-
<string>Add files to project...</string>
1274-
</property>
1275-
</action>
12761270
<action name="actionSubmit_to_Coursera">
12771271
<property name="icon">
12781272
<iconset resource="minizincide.qrc">

0 commit comments

Comments
 (0)