mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Use .contains() method directly
This commit is contained in:
parent
ea83c560ee
commit
47256467c8
@ -28,7 +28,7 @@ void ConsoleUILibraryCreator::createLibrary(const QString & name, const QString
|
|||||||
|
|
||||||
YACReaderLibraries yacreaderLibraries;
|
YACReaderLibraries yacreaderLibraries;
|
||||||
yacreaderLibraries.load();
|
yacreaderLibraries.load();
|
||||||
if (yacreaderLibraries.getNames().contains(name))
|
if (yacreaderLibraries.contains(name))
|
||||||
{
|
{
|
||||||
std::cout << "A Library named \"" << name.toUtf8().constData() << "\" already exists in database." << std::endl;
|
std::cout << "A Library named \"" << name.toUtf8().constData() << "\" already exists in database." << std::endl;
|
||||||
return;
|
return;
|
||||||
@ -96,7 +96,7 @@ void ConsoleUILibraryCreator::addExistingLibrary(const QString & name, const QSt
|
|||||||
|
|
||||||
YACReaderLibraries yacreaderLibraries;
|
YACReaderLibraries yacreaderLibraries;
|
||||||
yacreaderLibraries.load();
|
yacreaderLibraries.load();
|
||||||
if (yacreaderLibraries.getNames().contains(name))
|
if (yacreaderLibraries.contains(name))
|
||||||
{
|
{
|
||||||
std::cout << "A Library named \"" << name.toUtf8().constData() << "\" already exists in the database." << std::endl;
|
std::cout << "A Library named \"" << name.toUtf8().constData() << "\" already exists in the database." << std::endl;
|
||||||
return;
|
return;
|
||||||
@ -112,7 +112,7 @@ void ConsoleUILibraryCreator::removeLibrary(const QString & name)
|
|||||||
//TODO add error handling
|
//TODO add error handling
|
||||||
YACReaderLibraries yacreaderLibraries;
|
YACReaderLibraries yacreaderLibraries;
|
||||||
yacreaderLibraries.load();
|
yacreaderLibraries.load();
|
||||||
if (!yacreaderLibraries.getNames().contains(name))
|
if (!yacreaderLibraries.contains(name))
|
||||||
{
|
{
|
||||||
std::cout << "No Library named \"" << name.toUtf8().constData() << "\" in database." << std::endl;
|
std::cout << "No Library named \"" << name.toUtf8().constData() << "\" in database." << std::endl;
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user