projects/aports·blob master · refs

108 lines · 4.9 KiB

1By default the application has an expiry date, so it will stop working
26 months after version release date. Developer has given following
3explanation:
4
5https://www.vguitarforums.com/smf/index.php?msg=272762
6
7"The reason for having time limited versions from now on, is because
8some people are copying it and selling it on eBay as a CD with a patch
9library, and I wanted to try to foil their plans without having to do a
10paid registration on the editor.
11
12It is a little annoying for the average user having to download update
13it each year, but it will make their CD pressings obsolete from time to
14time."
15
16This patch removes the "time bomb", as the functionality was not meant
17for versions available in Linux distributions.
18
19--- a/mainWindow.cpp
20+++ b/mainWindow.cpp
21@@ -169,70 +169,6 @@
22 this->isTopLevel();
23
24 QString version = preferences->getPreferences("General", "Application", "version");
25- QDate date = QDate::currentDate();
26- int current_date = date.toString("yyyyMMdd").toInt(&ok,10);
27- QDate exp = QDate(version.midRef(0,4).toInt(&ok,10),version.midRef(4,2).toInt(&ok,10),version.midRef(6,2).toInt(&ok,10));
28- exp = exp.addDays(182); // expiry date 6 months from version release date.
29- int expiry_date = exp.toString("yyyyMMdd").toInt(&ok, 10);
30- exp = exp.addDays(-7);
31- int pending_expiry_date = exp.toString("yyyyMMdd").toInt(&ok, 10);
32- //qDebug() << "current=" << current_date << " expiry=" << expiry_date << " pending expiry=" << pending_expiry_date;
33- if(current_date>expiry_date)
34- {
35- QMessageBox *msgBox = new QMessageBox();
36- msgBox->setWindowTitle(deviceType + "FloorBoard Version expired on " + exp.toString("yyyyMMdd"));
37- msgBox->setIcon(QMessageBox::Warning);
38- msgBox->setTextFormat(Qt::RichText);
39- QString msgText;
40- msgText.append("<font size='+2'><b>");
41- msgText.append("This version of " + deviceType + "FxFloorBoard has expired on " + exp.toString("yyyyMMdd"));
42- msgText.append(tr("<br>please download and install a newer version"));
43- msgText.append(tr("<br> to be able to continue use .... closing app"));
44- msgText.append("<b></font>");
45- msgBox->setText(msgText);
46- msgBox->show();
47- uint x=10;
48- while (x>0)
49- {
50- QApplication::processEvents();
51- //QString num = QString::number(x, 10).toUpper();
52- msgText.append("<font size='+2'><b>");
53- msgText.append("* ");
54- msgText.append("<b></font>");
55- msgBox->setText(msgText);
56- SLEEP(1000);
57- QApplication::processEvents();
58- x--;
59- };
60- QDesktopServices::openUrl(QUrl("https://sourceforge.net/projects/grfloorboard/files/GR-55/"));
61- exit(1); // program exit with code 1 (normal app close).
62- }
63- else if(current_date>pending_expiry_date)
64- {
65- QMessageBox *msgBox = new QMessageBox();
66- msgBox->setWindowTitle(QString("This ") + deviceType + QString("FloorBoard version will expire on ") + QString::number(expiry_date));
67- msgBox->setIcon(QMessageBox::Warning);
68- msgBox->setTextFormat(Qt::RichText);
69- QString msgText;
70- msgText.append("<font size='+2'><b>");
71- msgText.append("This version of " + deviceType + "FloorBoard will expire soon");
72- msgText.append(tr("<br>please download and install a newer version"));
73- msgText.append(tr("<br> to be able to continue use"));
74- msgText.append("<b></font>");
75- msgBox->setText(msgText);
76- msgBox->show();
77- uint x=10;
78- while (x>0)
79- {
80- msgText.append("<font size='+2'><b>");
81- msgText.append("* ");
82- msgText.append("<b></font>");
83- msgBox->setText(msgText);
84- SLEEP(100);
85- QApplication::processEvents();
86- x--;
87- };
88- };
89 }
90
91 mainWindow::~mainWindow()
92@@ -1065,16 +1001,12 @@
93 QString version = preferences->getPreferences("General", "Application", "version");
94 QDate date = QDate::currentDate();
95 QString dateText = date.toString("yyyy");
96- QDate exp = QDate(version.midRef(0,4).toInt(&ok,10),version.midRef(4,2).toInt(&ok,10),version.midRef(6,2).toInt(&ok,10));
97- exp = exp.addDays(182); // expiry date 6 months from version release date.
98- QString expDate = exp.toString("yyyyMMdd").insert(6, "/").insert(4,"/").append(" (YYYY/MM/DD)");
99 QFile file(":about");
100 if(file.open(QIODevice::ReadOnly))
101 {
102 QMessageBox::about(this, deviceType + tr("FxFloorBoard - About"),
103 deviceType + "FxFloorBoard - " + version + "<br>"
104 + char(169) + tr(" Copyright ") + dateText + "<br>"
105- + tr("this version expires on ") + expDate + "<br>"
106 + file.readAll());
107 };
108 }