void InternetUpdater::httpFinished() { QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); if (reply->error()) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("get the new update failed: %1").arg(reply->errorString())); reply->deleteLater(); return; } else if (!redirectionTarget.isNull()) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QString("redirection denied to: %1").arg(redirectionTarget.toUrl().toString())); reply->deleteLater(); return; } QString newVersion=QString::fromUtf8(reply->readAll()); if(newVersion==ULTRACOPIER_VERSION) { reply->deleteLater(); return; } if(PluginsManager::compareVersion(newVersion,"<=",ULTRACOPIER_VERSION)) { reply->deleteLater(); return; } emit newUpdate(newVersion); reply->deleteLater(); }
void InternetUpdater::httpFinished() { QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); if (!reply->isFinished()) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("get the new update failed: not finished")); reply->deleteLater(); return; } else if (reply->error()) { newUpdateTimer.stop(); newUpdateTimer.start(1000*3600*24); ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("get the new update failed: %1").arg(reply->errorString())); reply->deleteLater(); return; } else if (!redirectionTarget.isNull()) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("redirection denied to: %1").arg(redirectionTarget.toUrl().toString())); reply->deleteLater(); return; } const QString &newVersion=QString::fromUtf8(reply->readAll()); if(newVersion.isEmpty()) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("version string is empty")); reply->deleteLater(); return; } if(!newVersion.contains(QRegularExpression(QLatin1Literal("^[0-9]+(\\.[0-9]+)+$")))) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("version string don't match: %1").arg(newVersion)); reply->deleteLater(); return; } if(newVersion==ULTRACOPIER_VERSION) { reply->deleteLater(); return; } if(PluginsManager::compareVersion(newVersion,QStringLiteral("<="),ULTRACOPIER_VERSION)) { reply->deleteLater(); return; } newUpdateTimer.stop(); emit newUpdate(newVersion); reply->deleteLater(); }
void PlaylistEdit::createConnections() { connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(aboutTano())); connect(ui->actionSettings, SIGNAL(triggered()), this, SLOT(settings())); connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(open())); connect(ui->actionNew, SIGNAL(triggered()), this, SLOT(newPlaylist())); connect(ui->actionDelete, SIGNAL(triggered()), this, SLOT(deleteItem())); connect(ui->actionAdd, SIGNAL(triggered()), this, SLOT(addItem())); connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(save())); connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(exit())); connect(ui->actionExport, SIGNAL(triggered()), this, SLOT(menuOpenExport())); connect(ui->actionExportTvheadend, SIGNAL(triggered()), this, SLOT(exportTvheadend())); connect(ui->actionExportXmltvId, SIGNAL(triggered()), this, SLOT(exportXmltvId())); connect(ui->actionPrint, SIGNAL(triggered()), this, SLOT(print())); connect(ui->editName, SIGNAL(textChanged(QString)), this, SLOT(setTitle(QString))); connect(ui->buttonApplyNum, SIGNAL(clicked()), this, SLOT(editChannelNumber())); connect(ui->editNumber, SIGNAL(returnPressed()), ui->buttonApplyNum, SLOT(click())); connect(ui->editChannelName, SIGNAL(textChanged(QString)), this, SLOT(editChannelName(QString))); connect(ui->editUrl, SIGNAL(textChanged(QString)), this, SLOT(editChannelUrl(QString))); connect(ui->editCategories, SIGNAL(textChanged(QString)), this, SLOT(editChannelCategories(QString))); connect(ui->editLanguage, SIGNAL(textChanged(QString)), this, SLOT(editChannelLanguage(QString))); connect(ui->editEpg, SIGNAL(textChanged(QString)), this, SLOT(editChannelEpg(QString))); connect(ui->editLogo, SIGNAL(textChanged(QString)), this, SLOT(editChannelLogo(QString))); connect(ui->actionUp, SIGNAL(triggered()), this, SLOT(moveUp())); connect(ui->actionDown, SIGNAL(triggered()), this, SLOT(moveDown())); connect(ui->playlist, SIGNAL(itemSelected(Channel *)), this, SLOT(editItem(Channel *))); #if EDITOR connect(_update, SIGNAL(newUpdate()), this, SLOT(updateAvailable())); connect(ui->actionUpdate, SIGNAL(triggered()), _update, SLOT(check())); #endif #if WITH_EDITOR_VLCQT connect(ui->buttonUpdate, SIGNAL(toggled(bool)), this, SLOT(refreshPlaylist(bool))); #endif }