2020-09-22 Fred Gleason <fredg@paravelsystems.com>

* Renamed the 'RDFeed::deleteImages()' method to
	'RDFeed::removeAllImages()'.
This commit is contained in:
Fred Gleason 2020-09-23 14:34:37 -04:00
parent 2cc77de8de
commit 26bcbcb86b
11 changed files with 13 additions and 58 deletions

View File

@ -20312,3 +20312,6 @@
* Incremented the database version to 337.
* Added a sanity check to the 'Image Manager' dialog in
rdadmin(1) to prevent deletion of in-use images.
2020-09-22 Fred Gleason <fredg@paravelsystems.com>
* Renamed the 'RDFeed::deleteImages()' method to
'RDFeed::removeAllImages()'.

View File

@ -1119,36 +1119,20 @@ bool RDFeed::removeImage(int img_id) const
}
bool RDFeed::deleteImages(QString *err_msg)
void RDFeed::removeAllImages()
{
RDDelete::ErrorCode conv_err=RDDelete::ErrorOk;
QString sql;
RDSqlQuery *q=NULL;
QString sql=QString("select ")+
"ID,"+ // 00
"FILE_EXTENSION "+ // 01
sql=QString("select ")+
"ID "+ // 00
"from FEED_IMAGES where "+
"FEED_KEY_NAME=\""+RDEscapeString(keyName())+"\"";
RDSqlQuery *q=new RDSqlQuery(sql);
QString().sprintf("FEED_ID=%u",feed_id);
q=new RDSqlQuery(sql);
while(q->next()) {
QString img_url=purgeUrl()+"/"+
RDFeed::imageFilename(id(),q->value(0).toInt(),q->value(1).toString());
RDDelete *conv=new RDDelete(rda->config());
if(!conv->urlIsSupported(img_url)) {
*err_msg="unsupported url scheme";
delete conv;
return false;
}
conv->setTargetUrl(img_url);
conv_err=conv->runDelete(purgeUsername(),purgePassword(),
rda->station()->sshIdentityFile(),
purgeUseIdFile(),
rda->config()->logXloadDebugData());
*err_msg=RDDelete::errorText(conv_err);
delete conv;
removeImage(q->value(0).toUInt());
}
delete q;
return conv_err==RDDelete::ErrorOk;
}

View File

@ -140,7 +140,7 @@ class RDFeed : public QObject
bool removeRss(QString *err_msg);
bool postImage(int img_id) const;
bool removeImage(int img_id) const;
bool deleteImages(QString *err_msg);
void removeAllImages();
unsigned postCut(const QString &cutname,Error *err);
unsigned postFile(const QString &srcfile,Error *err);
unsigned postLog(const QString &logname,const QTime &start_time,

View File

@ -262,11 +262,7 @@ void ListFeeds::deleteData()
//
// Delete Images
//
if(!feed->deleteImages(&errs)) {
QMessageBox::warning(this,"RDAdmin - "+tr("Warning"),
tr("Failed to delete remote images.")+
"["+errs+"].");
}
feed->removeAllImages();
sql=QString("delete from FEED_IMAGES where ")+
QString().sprintf("FEED_ID=%d",feed->id());
RDSqlQuery::apply(sql);

View File

@ -5192,10 +5192,6 @@ Stále ještě jej chcete smazat?</translation>
<source>Failed to delete remote feed XML.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to delete remote images.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished">Varování</translation>

View File

@ -4958,10 +4958,6 @@ Wollen Sie ihn immernoch löschen?</translation>
<source>Failed to delete remote feed XML.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to delete remote images.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>

View File

@ -5155,10 +5155,6 @@ Do you still want to delete it?</source>
<source>Failed to delete remote feed XML.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to delete remote images.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished">Advertencia</translation>

View File

@ -4104,10 +4104,6 @@ Permissions</source>
<source>Failed to delete remote feed XML.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to delete remote images.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>

View File

@ -4819,10 +4819,6 @@ Klikk på &quot;Lisens&quot;-knappen for fleire opplysningar.</translation>
<source>Failed to delete remote feed XML.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to delete remote images.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>

View File

@ -4819,10 +4819,6 @@ Klikk på &quot;Lisens&quot;-knappen for fleire opplysningar.</translation>
<source>Failed to delete remote feed XML.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to delete remote images.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>

View File

@ -4942,10 +4942,6 @@ Você ainda quer Deletar?</translation>
<source>Failed to delete remote feed XML.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Failed to delete remote images.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Warning</source>
<translation type="unfinished"></translation>