aports/testing/fxfloorboard-katana-mk2/remove-program-expiration-code.patch
2024-07-03 05:38:53 +00:00

108 lines
4.9 KiB
Diff

By default the application has an expiry date, so it will stop working
6 months after version release date. Developer has given following
explanation:
https://www.vguitarforums.com/smf/index.php?msg=272762
"The reason for having time limited versions from now on, is because
some people are copying it and selling it on eBay as a CD with a patch
library, and I wanted to try to foil their plans without having to do a
paid registration on the editor.
It is a little annoying for the average user having to download update
it each year, but it will make their CD pressings obsolete from time to
time."
This patch removes the "time bomb", as the functionality was not meant
for versions available in Linux distributions.
--- a/mainWindow.cpp
+++ b/mainWindow.cpp
@@ -169,70 +169,6 @@
this->isTopLevel();
QString version = preferences->getPreferences("General", "Application", "version");
- QDate date = QDate::currentDate();
- int current_date = date.toString("yyyyMMdd").toInt(&ok,10);
- QDate exp = QDate(version.midRef(0,4).toInt(&ok,10),version.midRef(4,2).toInt(&ok,10),version.midRef(6,2).toInt(&ok,10));
- exp = exp.addDays(182); // expiry date 6 months from version release date.
- int expiry_date = exp.toString("yyyyMMdd").toInt(&ok, 10);
- exp = exp.addDays(-7);
- int pending_expiry_date = exp.toString("yyyyMMdd").toInt(&ok, 10);
- //qDebug() << "current=" << current_date << " expiry=" << expiry_date << " pending expiry=" << pending_expiry_date;
- if(current_date>expiry_date)
- {
- QMessageBox *msgBox = new QMessageBox();
- msgBox->setWindowTitle(deviceType + "FloorBoard Version expired on " + exp.toString("yyyyMMdd"));
- msgBox->setIcon(QMessageBox::Warning);
- msgBox->setTextFormat(Qt::RichText);
- QString msgText;
- msgText.append("<font size='+2'><b>");
- msgText.append("This version of " + deviceType + "FxFloorBoard has expired on " + exp.toString("yyyyMMdd"));
- msgText.append(tr("<br>please download and install a newer version"));
- msgText.append(tr("<br> to be able to continue use .... closing app"));
- msgText.append("<b></font>");
- msgBox->setText(msgText);
- msgBox->show();
- uint x=10;
- while (x>0)
- {
- QApplication::processEvents();
- //QString num = QString::number(x, 10).toUpper();
- msgText.append("<font size='+2'><b>");
- msgText.append("* ");
- msgText.append("<b></font>");
- msgBox->setText(msgText);
- SLEEP(1000);
- QApplication::processEvents();
- x--;
- };
- QDesktopServices::openUrl(QUrl("https://sourceforge.net/projects/grfloorboard/files/GR-55/"));
- exit(1); // program exit with code 1 (normal app close).
- }
- else if(current_date>pending_expiry_date)
- {
- QMessageBox *msgBox = new QMessageBox();
- msgBox->setWindowTitle(QString("This ") + deviceType + QString("FloorBoard version will expire on ") + QString::number(expiry_date));
- msgBox->setIcon(QMessageBox::Warning);
- msgBox->setTextFormat(Qt::RichText);
- QString msgText;
- msgText.append("<font size='+2'><b>");
- msgText.append("This version of " + deviceType + "FloorBoard will expire soon");
- msgText.append(tr("<br>please download and install a newer version"));
- msgText.append(tr("<br> to be able to continue use"));
- msgText.append("<b></font>");
- msgBox->setText(msgText);
- msgBox->show();
- uint x=10;
- while (x>0)
- {
- msgText.append("<font size='+2'><b>");
- msgText.append("* ");
- msgText.append("<b></font>");
- msgBox->setText(msgText);
- SLEEP(100);
- QApplication::processEvents();
- x--;
- };
- };
}
mainWindow::~mainWindow()
@@ -1065,16 +1001,12 @@
QString version = preferences->getPreferences("General", "Application", "version");
QDate date = QDate::currentDate();
QString dateText = date.toString("yyyy");
- QDate exp = QDate(version.midRef(0,4).toInt(&ok,10),version.midRef(4,2).toInt(&ok,10),version.midRef(6,2).toInt(&ok,10));
- exp = exp.addDays(182); // expiry date 6 months from version release date.
- QString expDate = exp.toString("yyyyMMdd").insert(6, "/").insert(4,"/").append(" (YYYY/MM/DD)");
QFile file(":about");
if(file.open(QIODevice::ReadOnly))
{
QMessageBox::about(this, deviceType + tr("FxFloorBoard - About"),
deviceType + "FxFloorBoard - " + version + "<br>"
+ char(169) + tr(" Copyright ") + dateText + "<br>"
- + tr("this version expires on ") + expDate + "<br>"
+ file.readAll());
};
}