mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #2852 from thunder2/fix_rscollection
Renamed RsCollectionErrorCode::NO_ERROR to COLLECTION_NO_ERROR b…
This commit is contained in:
commit
55c414b400
@ -1 +1 @@
|
||||
Subproject commit 2ddc86fb575a61170f4c06a00152e3e7dc74c8f4
|
||||
Subproject commit a5a0f472d39c03d7442208b0d1c07cb429188341
|
@ -612,7 +612,7 @@ void SearchDialog::collOpen()
|
||||
RsCollection::RsCollectionErrorCode err;
|
||||
RsCollection collection(fileName, err);
|
||||
|
||||
if(err == RsCollection::RsCollectionErrorCode::NO_ERROR)
|
||||
if(err == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
|
||||
RsCollectionDialog::downloadFiles(collection);
|
||||
else
|
||||
QMessageBox::information(nullptr,tr("Error open RsCollection file"),RsCollection::errorString(err));
|
||||
|
@ -854,7 +854,7 @@ void SharedFilesDialog::collOpen()
|
||||
RsCollection::RsCollectionErrorCode err;
|
||||
RsCollection collection(fileName,err);
|
||||
|
||||
if(err == RsCollection::RsCollectionErrorCode::NO_ERROR)
|
||||
if(err == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
|
||||
RsCollectionDialog::downloadFiles(collection);
|
||||
}
|
||||
|
||||
|
@ -2571,7 +2571,7 @@ void TransfersDialog::collOpen()
|
||||
RsCollection::RsCollectionErrorCode code;
|
||||
RsCollection collection(fileName,code);
|
||||
|
||||
if(code == RsCollection::RsCollectionErrorCode::NO_ERROR)
|
||||
if(code == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
|
||||
RsCollectionDialog::downloadFiles(collection);
|
||||
else
|
||||
QMessageBox::information(nullptr,tr("Error openning collection file"),RsCollection::errorString(code));
|
||||
|
@ -1148,7 +1148,7 @@ QString RetroShareLink::toHtmlSize() const
|
||||
RsCollection::RsCollectionErrorCode code;
|
||||
RsCollection collection(QString::fromUtf8(finfo.path.c_str()), code) ;
|
||||
|
||||
if(code == RsCollection::RsCollectionErrorCode::NO_ERROR)
|
||||
if(code == RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
|
||||
size += QString(" [%1]").arg(misc::friendlyUnit(collection.size()));
|
||||
}
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ QString RsCollection::errorString(RsCollectionErrorCode code)
|
||||
{
|
||||
default: [[fallthrough]] ;
|
||||
case RsCollectionErrorCode::UNKNOWN_ERROR: return QObject::tr("Unknown error");
|
||||
case RsCollectionErrorCode::NO_ERROR: return QObject::tr("No error");
|
||||
case RsCollectionErrorCode::COLLECTION_NO_ERROR: return QObject::tr("No error");
|
||||
case RsCollectionErrorCode::FILE_READ_ERROR: return QObject::tr("Error while openning file");
|
||||
case RsCollectionErrorCode::FILE_CONTAINS_HARMFUL_STRINGS: return QObject::tr("Collection file contains potentially harmful code");
|
||||
case RsCollectionErrorCode::INVALID_ROOT_NODE: return QObject::tr("Invalid root node. RsCollection node was expected.");
|
||||
@ -214,7 +214,7 @@ RsCollection::RsCollection(const QString& fileName, RsCollectionErrorCode& error
|
||||
if(!recursParseXml(xml_doc,root,0))
|
||||
error = RsCollectionErrorCode::XML_PARSING_ERROR;
|
||||
else
|
||||
error = RsCollectionErrorCode::NO_ERROR;
|
||||
error = RsCollectionErrorCode::COLLECTION_NO_ERROR;
|
||||
}
|
||||
|
||||
// check that the file is a valid rscollection file, and not a lol bomb or some shit like this
|
||||
@ -222,7 +222,7 @@ RsCollection::RsCollection(const QString& fileName, RsCollectionErrorCode& error
|
||||
bool RsCollection::checkFile(const QString& fileName, RsCollectionErrorCode& error)
|
||||
{
|
||||
QFile file(fileName);
|
||||
error = RsCollectionErrorCode::NO_ERROR;
|
||||
error = RsCollectionErrorCode::COLLECTION_NO_ERROR;
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
|
@ -56,12 +56,12 @@ class RsCollection
|
||||
{
|
||||
public:
|
||||
enum class RsCollectionErrorCode:uint8_t {
|
||||
NO_ERROR = 0x00,
|
||||
COLLECTION_NO_ERROR = 0x00,
|
||||
UNKNOWN_ERROR = 0x01,
|
||||
FILE_READ_ERROR = 0x02,
|
||||
FILE_CONTAINS_HARMFUL_STRINGS = 0x03,
|
||||
INVALID_ROOT_NODE = 0x04,
|
||||
XML_PARSING_ERROR = 0x05,
|
||||
XML_PARSING_ERROR = 0x05
|
||||
};
|
||||
|
||||
RsCollection();
|
||||
|
@ -130,7 +130,7 @@ RsCollectionDialog::RsCollectionDialog(const QString& collectionFileName, RsColl
|
||||
RsCollection::RsCollectionErrorCode err_code;
|
||||
mCollection = new RsCollection(collectionFileName,err_code);
|
||||
|
||||
if(err_code != RsCollection::RsCollectionErrorCode::NO_ERROR)
|
||||
if(err_code != RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
|
||||
{
|
||||
QMessageBox::information(nullptr,tr("Could not load collection file"),tr("Could not load collection file"));
|
||||
close();
|
||||
@ -472,7 +472,7 @@ void RsCollectionDialog::changeFileName()
|
||||
|
||||
RsCollection qddOldFileCollection(fileName,err);
|
||||
|
||||
if(err != RsCollection::RsCollectionErrorCode::NO_ERROR)
|
||||
if(err != RsCollection::RsCollectionErrorCode::COLLECTION_NO_ERROR)
|
||||
{
|
||||
mCollectionModel->preMods();
|
||||
mCollection->merge_in(qddOldFileCollection.fileTree());
|
||||
|
Loading…
Reference in New Issue
Block a user