@@ -40,7 +40,7 @@ BookOperationStatus BookService::addBook(const QString& filePath)
4040 auto bookMetaData = m_bookMetadataHelper->getBookMetaData (filePath);
4141 if (!bookMetaData)
4242 {
43- qWarning () << " Could not open book at path: " << filePath;
43+ qWarning () << QString ( " Could not open book at path: %1 " ). arg ( filePath) ;
4444 return BookOperationStatus::OpeningBookFailed;
4545 }
4646
@@ -72,8 +72,9 @@ BookOperationStatus BookService::deleteBook(const QUuid& uuid)
7272{
7373 if (!getBook (uuid))
7474 {
75- qWarning () << " Could not delete book with uuid: " << uuid
76- << " . The book was not found." ;
75+ qWarning () << QString (" Could not delete book with uuid: %1. "
76+ " No book with this uuid exists." )
77+ .arg (uuid.toString ());
7778 return BookOperationStatus::BookDoesNotExist;
7879 }
7980
@@ -100,8 +101,9 @@ BookOperationStatus BookService::uninstallBook(const QUuid& uuid)
100101 auto book = getBook (uuid);
101102 if (!book)
102103 {
103- qWarning () << " Could not uninstall book with uuid: " << uuid
104- << " . No book with this uuid exists." ;
104+ qWarning () << QString (" Could not uninstall book with uuid: %1. "
105+ " No book with this uuid exists." )
106+ .arg (uuid.toString ());
105107 return BookOperationStatus::BookDoesNotExist;
106108 }
107109
@@ -119,8 +121,9 @@ BookOperationStatus BookService::updateBook(const Book& newBook)
119121 auto book = getBook (newBook.getUuid ());
120122 if (!book)
121123 {
122- qWarning () << " Could not update book with uuid: " << newBook.getUuid ()
123- << " . No book with this uuid exists." ;
124+ qWarning () << QString (" Failed updating book with uuid: %1."
125+ " No book with this uuid exists." )
126+ .arg (newBook.getUuid ().toString ());
124127 return BookOperationStatus::BookDoesNotExist;
125128 }
126129
@@ -148,16 +151,17 @@ BookOperationStatus BookService::addTag(const QUuid& uuid,
148151 auto book = getBook (uuid);
149152 if (!book)
150153 {
151- qWarning () << " Adding tag to book with uuid: " << uuid << " failed."
152- << " No book with this uuid exists." ;
154+ qWarning () << QString (" Adding tag to book with uuid: %1 failed. No "
155+ " book with this uuid exists." )
156+ .arg (uuid.toString ());
153157 return BookOperationStatus::BookDoesNotExist;
154158 }
155159
156160 if (!book->addTag (tag))
157161 {
158- qWarning () << " Adding tag called: " << tag. getName ()
159- << " to book with uuid: " << uuid << " failed."
160- << " A tag with this name already exists. " ;
162+ qWarning () << QString ( " Adding tag called: %1 to book with uuid: %2 "
163+ " failed. A tag with this name already exists. " )
164+ . arg (tag. getName (), uuid. toString ()) ;
161165 return BookOperationStatus::TagAlreadyExists;
162166 }
163167
@@ -176,16 +180,17 @@ BookOperationStatus BookService::removeTag(const QUuid& bookUuid,
176180 auto book = getBook (bookUuid);
177181 if (!book)
178182 {
179- qWarning () << " Removing tag from book with uuid: " << bookUuid
180- << " failed. No book with this uuid exists." ;
183+ qWarning () << QString (" Removing tag from book with uuid: %1 failed. No "
184+ " book with this uuid exists." )
185+ .arg (bookUuid.toString ());
181186 return BookOperationStatus::BookDoesNotExist;
182187 }
183188
184189 if (!book->removeTag (tagUuid))
185190 {
186- qWarning () << " Removing tag with uuid: " << tagUuid
187- << " from book with uuid: " << bookUuid << " failed."
188- << " No tag with this uuid exists. " ;
191+ qWarning () << QString ( " Removing tag with uuid: %1 from book with "
192+ " uuid: %2 failed. No tag with this uuid exists. " )
193+ . arg (tagUuid. toString (), bookUuid. toString ()) ;
189194 return BookOperationStatus::TagDoesNotExist;
190195 }
191196
@@ -205,17 +210,18 @@ BookOperationStatus BookService::renameTag(const QUuid& bookUuid,
205210 auto book = getBook (bookUuid);
206211 if (!book)
207212 {
208- qWarning () << " Renaming tag from book with uuid: " << bookUuid
209- << " failed. No book with this uuid exists." ;
213+ qWarning () << QString (" Renaming tag from book with uuid: %1 failed."
214+ " No book with this uuid exists." )
215+ .arg (bookUuid.toString ());
210216 return BookOperationStatus::BookDoesNotExist;
211217 }
212218
213219 if (!book->renameTag (tagUuid, newName))
214220 {
215- qWarning () << " Renaming tag with uuid: " << tagUuid
216- << " from book with uuid: " << bookUuid << " failed."
217- << " No tag with this uuid exists or a tag with this name"
218- " already exists. " ;
221+ qWarning () << QString ( " Renaming tag with uuid: %1 from book with "
222+ " uuid: %2 failed. No tag with this uuid exists "
223+ " or a tag with this name already exists. " )
224+ . arg (tagUuid. toString (), bookUuid. toString ()) ;
219225 return BookOperationStatus::TagDoesNotExist;
220226 }
221227
@@ -279,8 +285,9 @@ BookOperationStatus BookService::saveBookToFile(const QUuid& uuid,
279285 auto book = getBook (uuid);
280286 if (!book)
281287 {
282- qWarning () << " Saving book with uuid: " << uuid << " to file failed."
283- << " No book with this uuid exists." ;
288+ qWarning () << QString (" Saving book with uuid: %1 to folder %2 failed."
289+ " No book with this uuid exists." )
290+ .arg (uuid.toString (), pathToFolder.path ());
284291 return BookOperationStatus::BookDoesNotExist;
285292 }
286293
@@ -290,9 +297,10 @@ BookOperationStatus BookService::saveBookToFile(const QUuid& uuid,
290297 auto result = QFile::copy (currentBookPath.path (), destinaton.path ());
291298 if (!result)
292299 {
293- qWarning () << " Saving book with uuid: " << uuid
294- << " to folder: " << pathToFolder.toLocalFile () << " failed."
295- << " No book with this uuid exists." ;
300+ qWarning () << QString (" Saving book with uuid: %1 to folder: %2 failed. "
301+ " No book with this uuid exists." )
302+ .arg (uuid.toString (), pathToFolder.path ());
303+
296304 return BookOperationStatus::OperationFailed;
297305 }
298306
0 commit comments