Fix typos found via `codespell --skip .git -w`
This commit is contained in:
parent
ebf52dcf15
commit
b4d1df8592
|
@ -14,7 +14,7 @@ set(META_GUI_OPTIONAL true)
|
||||||
set(META_JS_SRC_DIR renamingutility)
|
set(META_JS_SRC_DIR renamingutility)
|
||||||
set(META_VERSION_MAJOR 3)
|
set(META_VERSION_MAJOR 3)
|
||||||
set(META_VERSION_MINOR 4)
|
set(META_VERSION_MINOR 4)
|
||||||
set(META_VERSION_PATCH 0)
|
set(META_VERSION_PATCH 1)
|
||||||
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON)
|
||||||
|
|
||||||
# add project files
|
# add project files
|
||||||
|
|
10
README.md
10
README.md
|
@ -63,7 +63,7 @@ tageditor set --index-pos front --force
|
||||||
### Padding
|
### Padding
|
||||||
Padding allows adding additional tag information without rewriting the entire file or appending the tag. Usage of
|
Padding allows adding additional tag information without rewriting the entire file or appending the tag. Usage of
|
||||||
padding can be configured:
|
padding can be configured:
|
||||||
- minimum/maximum padding: The file is rewritten if the padding would fall below/exceed the specifed limits.
|
- minimum/maximum padding: The file is rewritten if the padding would fall below/exceed the specified limits.
|
||||||
- preferred padding: If the file needs to be rewritten the preferred padding is used.
|
- preferred padding: If the file needs to be rewritten the preferred padding is used.
|
||||||
|
|
||||||
Default value for minimum and maximum padding is zero (in the CLI and GUI). This leads to the fact that
|
Default value for minimum and maximum padding is zero (in the CLI and GUI). This leads to the fact that
|
||||||
|
@ -225,7 +225,7 @@ Here are some Bash examples which illustrate getting and setting tag information
|
||||||
```
|
```
|
||||||
The number after the field name specifies the index of the first file to use the value for. The first index is 0.
|
The number after the field name specifies the index of the first file to use the value for. The first index is 0.
|
||||||
|
|
||||||
* Sets the title specificly for the track with the ID ``3134325680`` and removes
|
* Sets the title specifically for the track with the ID ``3134325680`` and removes
|
||||||
the tags targeting the song/track and the album/movie/episode in general:
|
the tags targeting the song/track and the album/movie/episode in general:
|
||||||
```
|
```
|
||||||
tageditor set target-level=30 target-tracks=3134325680 title="Title for track 3134325680" \
|
tageditor set target-level=30 target-tracks=3134325680 title="Title for track 3134325680" \
|
||||||
|
@ -311,11 +311,11 @@ Here are some Bash examples which illustrate getting and setting tag information
|
||||||
3. The CLI prints all values in UTF-8 encoding (no matter which encoding is actually used in the tag).
|
3. The CLI prints all values in UTF-8 encoding (no matter which encoding is actually used in the tag).
|
||||||
|
|
||||||
## Build instructions
|
## Build instructions
|
||||||
The application depends on [c++utilities](https://github.com/Martchus/cpp-utilities) and [tagparser](https://github.com/Martchus/tagparser) and is built the same way as these libaries. For basic instructions checkout the README file of [c++utilities](https://github.com/Martchus/cpp-utilities).
|
The application depends on [c++utilities](https://github.com/Martchus/cpp-utilities) and [tagparser](https://github.com/Martchus/tagparser) and is built the same way as these libraries. For basic instructions checkout the README file of [c++utilities](https://github.com/Martchus/cpp-utilities).
|
||||||
When the Qt GUI is enabled, Qt and [qtutilities](https://github.com/Martchus/qtutilities) are required, too.
|
When the Qt GUI is enabled, Qt and [qtutilities](https://github.com/Martchus/qtutilities) are required, too.
|
||||||
|
|
||||||
### Building with Qt GUI
|
### Building with Qt GUI
|
||||||
The following Qt modules are requried (version 5.6 or higher): core concurrent gui network widgets declarative/script webenginewidgets/webkitwidgets
|
The following Qt modules are required (version 5.6 or higher): core concurrent gui network widgets declarative/script webenginewidgets/webkitwidgets
|
||||||
|
|
||||||
Note that old Qt versions like 5.6 lack support for modern JavaScript features. To use the JavaScript-based renaming tool
|
Note that old Qt versions like 5.6 lack support for modern JavaScript features. To use the JavaScript-based renaming tool
|
||||||
is recommend to use at least Qt 5.12.
|
is recommend to use at least Qt 5.12.
|
||||||
|
@ -343,7 +343,7 @@ When enabled, the following additional dependencies are required (only at build-
|
||||||
|
|
||||||
### Building this straight
|
### Building this straight
|
||||||
0. Install (preferably the latest version of) g++ or clang, the required Qt modules and CMake.
|
0. Install (preferably the latest version of) g++ or clang, the required Qt modules and CMake.
|
||||||
1. Get the sources of additional dependencies and the tag editor itself. For the lastest version from Git clone the following repositories:
|
1. Get the sources of additional dependencies and the tag editor itself. For the latest version from Git clone the following repositories:
|
||||||
```
|
```
|
||||||
cd $SOURCES
|
cd $SOURCES
|
||||||
git clone https://github.com/Martchus/cpp-utilities.git c++utilities
|
git clone https://github.com/Martchus/cpp-utilities.git c++utilities
|
||||||
|
|
|
@ -50,7 +50,7 @@ SetTagInfoArgs::SetTagInfoArgs(Argument &filesArg, Argument &verboseArg)
|
||||||
, id3InitOnCreateArg("id3-init-on-create", '\0',
|
, id3InitOnCreateArg("id3-init-on-create", '\0',
|
||||||
"indicates whether to initialize newly created ID3 tags (according to specified usage) with the values of the already present ID3 tags")
|
"indicates whether to initialize newly created ID3 tags (according to specified usage) with the values of the already present ID3 tags")
|
||||||
, id3TransferOnRemovalArg("id3-transfer-on-removal", '\0',
|
, id3TransferOnRemovalArg("id3-transfer-on-removal", '\0',
|
||||||
"indicates whether values of removed ID3 tags (according to specified usage) should be transfered to remaining ID3 tags (no values will be "
|
"indicates whether values of removed ID3 tags (according to specified usage) should be transferred to remaining ID3 tags (no values will be "
|
||||||
"overwritten)")
|
"overwritten)")
|
||||||
, encodingArg("encoding", '\0', "specifies the preferred encoding", { "latin1/utf8/utf16le/utf16be" })
|
, encodingArg("encoding", '\0', "specifies the preferred encoding", { "latin1/utf8/utf16le/utf16be" })
|
||||||
, removeTargetArg("remove-target", '\0', "removes all tags with the specified target")
|
, removeTargetArg("remove-target", '\0', "removes all tags with the specified target")
|
||||||
|
|
|
@ -75,7 +75,7 @@ bool InterruptHandler::s_handlerRegistered = false;
|
||||||
/*!
|
/*!
|
||||||
* \brief Registers the specified \a handler for SIGINT and SIGTERM as long as this object is alive.
|
* \brief Registers the specified \a handler for SIGINT and SIGTERM as long as this object is alive.
|
||||||
* \remarks The specified \a handler should only call functions which are permitted to be used in signal handlers
|
* \remarks The specified \a handler should only call functions which are permitted to be used in signal handlers
|
||||||
* (eg. use POSIX write() instread of std::cout).
|
* (eg. use POSIX write() instead of std::cout).
|
||||||
* \throws Throws std::runtime_error when attempting to create a 2nd instance.
|
* \throws Throws std::runtime_error when attempting to create a 2nd instance.
|
||||||
*/
|
*/
|
||||||
InterruptHandler::InterruptHandler(std::function<void()> handler)
|
InterruptHandler::InterruptHandler(std::function<void()> handler)
|
||||||
|
@ -666,7 +666,7 @@ FieldDenotations parseFieldDenotations(const Argument &fieldsArg, bool readOnly)
|
||||||
<< "note: This is only possible when the \"set\"-operation is used." << endl;
|
<< "note: This is only possible when the \"set\"-operation is used." << endl;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
} else {
|
} else {
|
||||||
// file index might have been specified explicitely
|
// file index might have been specified explicitly
|
||||||
// if not (mult == 1) use the index of the last value and increase it by one if the value is not an additional one
|
// if not (mult == 1) use the index of the last value and increase it by one if the value is not an additional one
|
||||||
// if there are no previous values, just use the index 0
|
// if there are no previous values, just use the index 0
|
||||||
fieldValues.allValues.emplace_back(type,
|
fieldValues.allValues.emplace_back(type,
|
||||||
|
|
|
@ -130,13 +130,13 @@ void generateFileInfo(const ArgumentOccurrence &, const Argument &inputFileArg,
|
||||||
cout << "File information has been saved to \"" << outputFileArg.values().front() << "\"." << endl;
|
cout << "File information has been saved to \"" << outputFileArg.values().front() << "\"." << endl;
|
||||||
} else {
|
} else {
|
||||||
const auto errorMessage = file.errorString().toUtf8();
|
const auto errorMessage = file.errorString().toUtf8();
|
||||||
cerr << Phrases::Error << "An IO error occured when writing the file \"" << outputFileArg.values().front()
|
cerr << Phrases::Error << "An IO error occurred when writing the file \"" << outputFileArg.values().front()
|
||||||
<< "\": " << std::string_view(errorMessage.data(), errorMessage.size()) << Phrases::EndFlush;
|
<< "\": " << std::string_view(errorMessage.data(), errorMessage.size()) << Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
} catch (const TagParser::Failure &) {
|
} catch (const TagParser::Failure &) {
|
||||||
cerr << Phrases::Error << "A parsing failure occured when reading the file \"" << inputFileArg.values().front() << "\"." << Phrases::EndFlush;
|
cerr << Phrases::Error << "A parsing failure occurred when reading the file \"" << inputFileArg.values().front() << "\"." << Phrases::EndFlush;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
cerr << Phrases::Error << "An IO error occured when reading the file \"" << inputFileArg.values().front() << "\": " << e.what()
|
cerr << Phrases::Error << "An IO error occurred when reading the file \"" << inputFileArg.values().front() << "\": " << e.what()
|
||||||
<< Phrases::EndFlush;
|
<< Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -318,9 +318,9 @@ void displayFileInfo(const ArgumentOccurrence &, const Argument &filesArg, const
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (const TagParser::Failure &) {
|
} catch (const TagParser::Failure &) {
|
||||||
cerr << Phrases::Error << "A parsing failure occured when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
cerr << Phrases::Error << "A parsing failure occurred when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
||||||
} catch (const std::ios_base::failure &) {
|
} catch (const std::ios_base::failure &) {
|
||||||
cerr << Phrases::Error << "An IO error occured when reading the file \"" << file << "\"" << Phrases::EndFlush;
|
cerr << Phrases::Error << "An IO error occurred when reading the file \"" << file << "\"" << Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
|
|
||||||
printDiagMessages(diag, "Diagnostic messages:", verboseArg.isPresent());
|
printDiagMessages(diag, "Diagnostic messages:", verboseArg.isPresent());
|
||||||
|
@ -381,9 +381,9 @@ void displayTagInfo(const Argument &fieldsArg, const Argument &showUnsupportedAr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (const TagParser::Failure &) {
|
} catch (const TagParser::Failure &) {
|
||||||
cerr << Phrases::Error << "A parsing failure occured when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
cerr << Phrases::Error << "A parsing failure occurred when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
||||||
} catch (const std::ios_base::failure &) {
|
} catch (const std::ios_base::failure &) {
|
||||||
cerr << Phrases::Error << "An IO error occured when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
cerr << Phrases::Error << "An IO error occurred when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
printDiagMessages(diag, "Diagnostic messages:", verboseArg.isPresent());
|
printDiagMessages(diag, "Diagnostic messages:", verboseArg.isPresent());
|
||||||
cout << endl;
|
cout << endl;
|
||||||
|
@ -572,7 +572,7 @@ void setTagInfo(const SetTagInfoArgs &args)
|
||||||
Diagnostics diag;
|
Diagnostics diag;
|
||||||
AbortableProgressFeedback parsingProgress; // FIXME: actually use the progress object
|
AbortableProgressFeedback parsingProgress; // FIXME: actually use the progress object
|
||||||
try {
|
try {
|
||||||
// parse tags and tracks (tracks are relevent because track meta-data such as language can be changed as well)
|
// parse tags and tracks (tracks are relevant because track meta-data such as language can be changed as well)
|
||||||
if (!quiet) {
|
if (!quiet) {
|
||||||
cout << TextAttribute::Bold << "Setting tag information for \"" << file << "\" ..." << Phrases::EndFlush;
|
cout << TextAttribute::Bold << "Setting tag information for \"" << file << "\" ..." << Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
|
@ -731,7 +731,7 @@ void setTagInfo(const SetTagInfoArgs &args)
|
||||||
diag.emplace_back(DiagLevel::Critical, "Unable to parse specified file.", context);
|
diag.emplace_back(DiagLevel::Critical, "Unable to parse specified file.", context);
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
diag.emplace_back(
|
diag.emplace_back(
|
||||||
DiagLevel::Critical, argsToString("An IO error occured when parsing the specified file: ", e.what()), context);
|
DiagLevel::Critical, argsToString("An IO error occurred when parsing the specified file: ", e.what()), context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// finally set the values
|
// finally set the values
|
||||||
|
@ -894,10 +894,10 @@ void setTagInfo(const SetTagInfoArgs &args)
|
||||||
}
|
}
|
||||||
} catch (const TagParser::Failure &) {
|
} catch (const TagParser::Failure &) {
|
||||||
finalizeLog();
|
finalizeLog();
|
||||||
cerr << " - " << Phrases::Error << "A parsing failure occured when reading/writing the file \"" << file << "\"." << Phrases::EndFlush;
|
cerr << " - " << Phrases::Error << "A parsing failure occurred when reading/writing the file \"" << file << "\"." << Phrases::EndFlush;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
finalizeLog();
|
finalizeLog();
|
||||||
cerr << " - " << Phrases::Error << "An IO error occured when reading/writing the file \"" << file << "\": " << e.what()
|
cerr << " - " << Phrases::Error << "An IO error occurred when reading/writing the file \"" << file << "\": " << e.what()
|
||||||
<< Phrases::EndFlush;
|
<< Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -924,7 +924,7 @@ void extractField(
|
||||||
}
|
}
|
||||||
if (((fieldDenotations.size() != 1) || (!attachmentInfo.hasId && !attachmentInfo.name))
|
if (((fieldDenotations.size() != 1) || (!attachmentInfo.hasId && !attachmentInfo.name))
|
||||||
&& ((fieldDenotations.size() == 1) && (attachmentInfo.hasId || attachmentInfo.name))) {
|
&& ((fieldDenotations.size() == 1) && (attachmentInfo.hasId || attachmentInfo.name))) {
|
||||||
cerr << Phrases::Error << "Excactly one field or attachment needs to be specified." << Phrases::EndFlush;
|
cerr << Phrases::Error << "Exactly one field or attachment needs to be specified." << Phrases::EndFlush;
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
if (!inputFilesArg.isPresent() || inputFilesArg.values().empty()) {
|
if (!inputFilesArg.isPresent() || inputFilesArg.values().empty()) {
|
||||||
|
@ -989,7 +989,7 @@ void extractField(
|
||||||
outputFileStream.flush();
|
outputFileStream.flush();
|
||||||
cout << " - Value has been saved to \"" << path << "\"." << endl;
|
cout << " - Value has been saved to \"" << path << "\"." << endl;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
cerr << " - " << Phrases::Error << "An IO error occured when writing the file \"" << path << "\": " << e.what()
|
cerr << " - " << Phrases::Error << "An IO error occurred when writing the file \"" << path << "\": " << e.what()
|
||||||
<< Phrases::End;
|
<< Phrases::End;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1040,7 +1040,7 @@ void extractField(
|
||||||
outputFileStream.flush();
|
outputFileStream.flush();
|
||||||
cout << " - Value has been saved to \"" << path << "\"." << endl;
|
cout << " - Value has been saved to \"" << path << "\"." << endl;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
cerr << " - " << Phrases::Error << "An IO error occured when writing the file \"" << path << "\": " << e.what()
|
cerr << " - " << Phrases::Error << "An IO error occurred when writing the file \"" << path << "\": " << e.what()
|
||||||
<< Phrases::EndFlush;
|
<< Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1052,9 +1052,9 @@ void extractField(
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (const TagParser::Failure &) {
|
} catch (const TagParser::Failure &) {
|
||||||
cerr << Phrases::Error << "A parsing failure occured when reading the file \"" << file << "\"." << Phrases::End;
|
cerr << Phrases::Error << "A parsing failure occurred when reading the file \"" << file << "\"." << Phrases::End;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
cerr << Phrases::Error << "An IO error occured when reading the file \"" << file << "\": " << e.what() << Phrases::End;
|
cerr << Phrases::Error << "An IO error occurred when reading the file \"" << file << "\": " << e.what() << Phrases::End;
|
||||||
}
|
}
|
||||||
printDiagMessages(diag, "Diagnostic messages:", verboseArg.isPresent());
|
printDiagMessages(diag, "Diagnostic messages:", verboseArg.isPresent());
|
||||||
}
|
}
|
||||||
|
@ -1088,9 +1088,9 @@ void exportToJson(const ArgumentOccurrence &, const Argument &filesArg, const Ar
|
||||||
fileInfo.parseTracks(diag, progress);
|
fileInfo.parseTracks(diag, progress);
|
||||||
jsonData.emplace_back(fileInfo, document.GetAllocator());
|
jsonData.emplace_back(fileInfo, document.GetAllocator());
|
||||||
} catch (const TagParser::Failure &) {
|
} catch (const TagParser::Failure &) {
|
||||||
cerr << Phrases::Error << "A parsing failure occured when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
cerr << Phrases::Error << "A parsing failure occurred when reading the file \"" << file << "\"." << Phrases::EndFlush;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
cerr << Phrases::Error << "An IO error occured when reading the file \"" << file << "\": " << e.what() << Phrases::EndFlush;
|
cerr << Phrases::Error << "An IO error occurred when reading the file \"" << file << "\": " << e.what() << Phrases::EndFlush;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ const QByteArray *QueryResultsModel::cover(const QModelIndex &index) const
|
||||||
/*!
|
/*!
|
||||||
* \brief Fetches the cover the specified \a index.
|
* \brief Fetches the cover the specified \a index.
|
||||||
* \returns
|
* \returns
|
||||||
* - true if the cover is immidiately available or an error occurs immidiately
|
* - true if the cover is immediately available or an error occurs immediately
|
||||||
* - and false if the cover will be fetched asynchronously.
|
* - and false if the cover will be fetched asynchronously.
|
||||||
*
|
*
|
||||||
* If the cover is fetched asynchronously the coverAvailable() signal is emitted, when the cover
|
* If the cover is fetched asynchronously the coverAvailable() signal is emitted, when the cover
|
||||||
|
@ -243,7 +243,7 @@ const QString *QueryResultsModel::lyrics(const QModelIndex &index) const
|
||||||
/*!
|
/*!
|
||||||
* \brief Fetches the lyrics the specified \a index.
|
* \brief Fetches the lyrics the specified \a index.
|
||||||
* \returns
|
* \returns
|
||||||
* - true if the lyrics are immidiately available or an error occurs immidiately
|
* - true if the lyrics are immediately available or an error occurs immediately
|
||||||
* - and false if the lyrics will be fetched asynchronously.
|
* - and false if the lyrics will be fetched asynchronously.
|
||||||
*
|
*
|
||||||
* If the lyrics are fetched asynchronously the lyricsAvailable() signal is emitted, when the lyrics
|
* If the lyrics are fetched asynchronously the lyricsAvailable() signal is emitted, when the lyrics
|
||||||
|
|
|
@ -286,7 +286,7 @@ void LyricsWikiaResultsModel::parseSongDetails(int row, const QByteArray &data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// requets lyrics (lyrics are trunacted in XML response so just get them via the regular Wiki page)
|
// requets lyrics (lyrics are truncated in XML response so just get them via the regular Wiki page)
|
||||||
// -> fall back to self-crafted URL if it was not possible to parse it from XML
|
// -> fall back to self-crafted URL if it was not possible to parse it from XML
|
||||||
if (parsedUrl.isEmpty()) {
|
if (parsedUrl.isEmpty()) {
|
||||||
lazyInitializeLyricsWikiaSongId(assocDesc);
|
lazyInitializeLyricsWikiaSongId(assocDesc);
|
||||||
|
|
|
@ -118,7 +118,7 @@ void AttachmentsEdit::showFileSelection()
|
||||||
tr("The file couldn't be added because the attachments of the file could not be parsed successfully."));
|
tr("The file couldn't be added because the attachments of the file could not be parsed successfully."));
|
||||||
} catch (const std::ios_base::failure &failure) {
|
} catch (const std::ios_base::failure &failure) {
|
||||||
QMessageBox::warning(this, QApplication::applicationName(),
|
QMessageBox::warning(this, QApplication::applicationName(),
|
||||||
tr("The file couldn't be added because an IO error occured: ") + QString::fromLocal8Bit(failure.what()));
|
tr("The file couldn't be added because an IO error occurred: ") + QString::fromLocal8Bit(failure.what()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ void AttachmentsEdit::extractSelected()
|
||||||
helper.copy(input, file, data->size());
|
helper.copy(input, file, data->size());
|
||||||
} catch (const std::ios_base::failure &failure) {
|
} catch (const std::ios_base::failure &failure) {
|
||||||
QMessageBox::warning(this, QApplication::applicationName(),
|
QMessageBox::warning(this, QApplication::applicationName(),
|
||||||
tr("An IO error occured when extracting the attached file: ") + QString::fromLocal8Bit(failure.what()));
|
tr("An IO error occurred when extracting the attached file: ") + QString::fromLocal8Bit(failure.what()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -445,7 +445,7 @@ void MainWindow::selectNextFile(QItemSelectionModel *selectionModel, const QMode
|
||||||
if (m_fileFilterModel->canFetchMore(currentIndex)) {
|
if (m_fileFilterModel->canFetchMore(currentIndex)) {
|
||||||
// files and subdirectories have to be fetched
|
// files and subdirectories have to be fetched
|
||||||
// -> QFileSystemModel seems to fetch files and directories async
|
// -> QFileSystemModel seems to fetch files and directories async
|
||||||
// -> hence fetchMore will return immediatly
|
// -> hence fetchMore will return immediately
|
||||||
// -> select next file when rowsInserted is emitted
|
// -> select next file when rowsInserted is emitted
|
||||||
auto conn = make_shared<QMetaObject::Connection>();
|
auto conn = make_shared<QMetaObject::Connection>();
|
||||||
*conn = connect(m_fileFilterModel, &QAbstractItemModel::rowsInserted,
|
*conn = connect(m_fileFilterModel, &QAbstractItemModel::rowsInserted,
|
||||||
|
|
|
@ -448,7 +448,7 @@ void PicturePreviewSelection::addOfSelectedType(const QString &path)
|
||||||
} catch (const TagParser::Failure &) {
|
} catch (const TagParser::Failure &) {
|
||||||
QMessageBox::critical(this, QCoreApplication::applicationName(), tr("Unable to parse specified cover file."));
|
QMessageBox::critical(this, QCoreApplication::applicationName(), tr("Unable to parse specified cover file."));
|
||||||
} catch (const std::ios_base::failure &) {
|
} catch (const std::ios_base::failure &) {
|
||||||
QMessageBox::critical(this, QCoreApplication::applicationName(), tr("An IO error occured when parsing the specified cover file."));
|
QMessageBox::critical(this, QCoreApplication::applicationName(), tr("An IO error occurred when parsing the specified cover file."));
|
||||||
}
|
}
|
||||||
updatePreview(m_currentTypeIndex);
|
updatePreview(m_currentTypeIndex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,7 +176,7 @@ void RenameFilesDialog::startGeneratingPreview()
|
||||||
m_ui->notificationLabel->setText(
|
m_ui->notificationLabel->setText(
|
||||||
tr("The script is not valid.\nError in line %1: %3").arg(m_engine->errorLineNumber()).arg(m_engine->errorMessage()));
|
tr("The script is not valid.\nError in line %1: %3").arg(m_engine->errorLineNumber()).arg(m_engine->errorMessage()));
|
||||||
} else {
|
} else {
|
||||||
m_ui->notificationLabel->setText(tr("An error occured when parsing the script: %1").arg(m_engine->errorMessage()));
|
m_ui->notificationLabel->setText(tr("An error occurred when parsing the script: %1").arg(m_engine->errorMessage()));
|
||||||
}
|
}
|
||||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||||
}
|
}
|
||||||
|
@ -214,7 +214,7 @@ void RenameFilesDialog::showPreviewProgress(int itemsProcessed, int errorsOccure
|
||||||
QString text = tr("%1 files/directories processed", nullptr, itemsProcessed).arg(itemsProcessed);
|
QString text = tr("%1 files/directories processed", nullptr, itemsProcessed).arg(itemsProcessed);
|
||||||
if (m_errorsOccured > 0) {
|
if (m_errorsOccured > 0) {
|
||||||
text.append(QChar('\n'));
|
text.append(QChar('\n'));
|
||||||
text.append(tr("%1 error(s) occured", nullptr, errorsOccured).arg(errorsOccured));
|
text.append(tr("%1 error(s) occurred", nullptr, errorsOccured).arg(errorsOccured));
|
||||||
}
|
}
|
||||||
m_ui->notificationLabel->setText(text);
|
m_ui->notificationLabel->setText(text);
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ void RenameFilesDialog::showPreviewResults()
|
||||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||||
}
|
}
|
||||||
if (m_errorsOccured) {
|
if (m_errorsOccured) {
|
||||||
m_ui->notificationLabel->appendLine(tr("%1 error(s) occured.", nullptr, m_errorsOccured).arg(m_errorsOccured));
|
m_ui->notificationLabel->appendLine(tr("%1 error(s) occurred.", nullptr, m_errorsOccured).arg(m_errorsOccured));
|
||||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -257,7 +257,7 @@ void RenameFilesDialog::showChangsingsResults()
|
||||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||||
}
|
}
|
||||||
if (m_errorsOccured) {
|
if (m_errorsOccured) {
|
||||||
m_ui->notificationLabel->appendLine(tr("%1 error(s) occured.", nullptr, m_errorsOccured).arg(m_errorsOccured));
|
m_ui->notificationLabel->appendLine(tr("%1 error(s) occurred.", nullptr, m_errorsOccured).arg(m_errorsOccured));
|
||||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,7 @@ void TagEditorWidget::updateTagEditsAndAttachmentEdits(bool updateUi, PreviousVa
|
||||||
tagsByTarget[index] << tag;
|
tagsByTarget[index] << tag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// create a singe editor per target or seperate editors for each tag depending on the settings
|
// create a single editor per target or separate editors for each tag depending on the settings
|
||||||
bool hasAutoCorrectionBeenApplied = false;
|
bool hasAutoCorrectionBeenApplied = false;
|
||||||
switch (Settings::values().editor.multipleTagHandling) {
|
switch (Settings::values().editor.multipleTagHandling) {
|
||||||
case Settings::MultipleTagHandling::SingleEditorPerTarget:
|
case Settings::MultipleTagHandling::SingleEditorPerTarget:
|
||||||
|
@ -403,7 +403,7 @@ void TagEditorWidget::updateTagEditsAndAttachmentEdits(bool updateUi, PreviousVa
|
||||||
addParsingNotificationLine(tr("Some values have been changed by the auto-correction."));
|
addParsingNotificationLine(tr("Some values have been changed by the auto-correction."));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// there are no tags -> leave one edit existend but ensure no tags are assigned
|
// there are no tags -> leave one edit existed but ensure no tags are assigned
|
||||||
fetchNextEdit();
|
fetchNextEdit();
|
||||||
edit->setTag(nullptr, false);
|
edit->setTag(nullptr, false);
|
||||||
++widgetIndex;
|
++widgetIndex;
|
||||||
|
@ -787,7 +787,7 @@ void TagEditorWidget::foreachTagEdit(const std::function<void(TagEdit *)> &funct
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the active tag edit or nullptr if there is currently no acitve tag edit.
|
* \brief Returns the active tag edit or nullptr if there is currently no active tag edit.
|
||||||
*/
|
*/
|
||||||
TagEdit *TagEditorWidget::activeTagEdit()
|
TagEdit *TagEditorWidget::activeTagEdit()
|
||||||
{
|
{
|
||||||
|
@ -830,7 +830,7 @@ bool TagEditorWidget::startParsing(const QString &path, bool forceRefresh)
|
||||||
m_currentDir = fileInfo.absolutePath();
|
m_currentDir = fileInfo.absolutePath();
|
||||||
m_fileName = fileInfo.fileName();
|
m_fileName = fileInfo.fileName();
|
||||||
}
|
}
|
||||||
// write diagnostics to m_diagReparsing if making results are avalable
|
// write diagnostics to m_diagReparsing if making results are available
|
||||||
m_makingResultsAvailable &= sameFile;
|
m_makingResultsAvailable &= sameFile;
|
||||||
Diagnostics &diag = m_makingResultsAvailable ? m_diagReparsing : m_diag;
|
Diagnostics &diag = m_makingResultsAvailable ? m_diagReparsing : m_diag;
|
||||||
// clear diagnostics
|
// clear diagnostics
|
||||||
|
@ -858,7 +858,7 @@ bool TagEditorWidget::startParsing(const QString &path, bool forceRefresh)
|
||||||
// the file has been opened; parsing notifications will be shown in the info box
|
// the file has been opened; parsing notifications will be shown in the info box
|
||||||
result = FatalParsingError;
|
result = FatalParsingError;
|
||||||
} catch (const std::ios_base::failure &e) {
|
} catch (const std::ios_base::failure &e) {
|
||||||
// the file could not be opened because an IO error occured
|
// the file could not be opened because an IO error occurred
|
||||||
m_fileInfo.close(); // ensure file is closed
|
m_fileInfo.close(); // ensure file is closed
|
||||||
result = IoError;
|
result = IoError;
|
||||||
if ((ioError = QString::fromLocal8Bit(e.what())).isEmpty()) {
|
if ((ioError = QString::fromLocal8Bit(e.what())).isEmpty()) {
|
||||||
|
@ -901,7 +901,7 @@ bool TagEditorWidget::reparseFile()
|
||||||
* \brief Shows the current file info (technical info, tags, ...).
|
* \brief Shows the current file info (technical info, tags, ...).
|
||||||
* This private slot is invoked from the thread which performed the
|
* This private slot is invoked from the thread which performed the
|
||||||
* parsing operation using Qt::QueuedConnection.
|
* parsing operation using Qt::QueuedConnection.
|
||||||
* \param result Specifies whether the file could be load sucessfully.
|
* \param result Specifies whether the file could be load successfully.
|
||||||
*/
|
*/
|
||||||
void TagEditorWidget::showFile(char result, const QString &ioError)
|
void TagEditorWidget::showFile(char result, const QString &ioError)
|
||||||
{
|
{
|
||||||
|
@ -961,7 +961,7 @@ void TagEditorWidget::showFile(char result, const QString &ioError)
|
||||||
diagLevel |= m_diagReparsing.level();
|
diagLevel |= m_diagReparsing.level();
|
||||||
}
|
}
|
||||||
if (diagLevel >= DiagLevel::Critical) {
|
if (diagLevel >= DiagLevel::Critical) {
|
||||||
// we catched no exception, but there are critical diag messages
|
// we caught no exception, but there are critical diag messages
|
||||||
// -> treat those as fatal parsing errors
|
// -> treat those as fatal parsing errors
|
||||||
result = LoadingResult::FatalParsingError;
|
result = LoadingResult::FatalParsingError;
|
||||||
}
|
}
|
||||||
|
@ -977,7 +977,7 @@ void TagEditorWidget::showFile(char result, const QString &ioError)
|
||||||
bool multipleSegmentsNotTested = m_fileInfo.containerFormat() == ContainerFormat::Matroska && m_fileInfo.container()->segmentCount() > 1;
|
bool multipleSegmentsNotTested = m_fileInfo.containerFormat() == ContainerFormat::Matroska && m_fileInfo.container()->segmentCount() > 1;
|
||||||
if (diagLevel >= TagParser::DiagLevel::Critical) {
|
if (diagLevel >= TagParser::DiagLevel::Critical) {
|
||||||
m_ui->parsingNotificationWidget->setNotificationType(NotificationType::Critical);
|
m_ui->parsingNotificationWidget->setNotificationType(NotificationType::Critical);
|
||||||
m_ui->parsingNotificationWidget->appendLine(tr("Errors occured."));
|
m_ui->parsingNotificationWidget->appendLine(tr("Errors occurred."));
|
||||||
} else if (diagLevel == TagParser::DiagLevel::Warning || m_fileInfo.isReadOnly() || !m_fileInfo.areTagsSupported() || multipleSegmentsNotTested) {
|
} else if (diagLevel == TagParser::DiagLevel::Warning || m_fileInfo.isReadOnly() || !m_fileInfo.areTagsSupported() || multipleSegmentsNotTested) {
|
||||||
m_ui->parsingNotificationWidget->setNotificationType(NotificationType::Warning);
|
m_ui->parsingNotificationWidget->setNotificationType(NotificationType::Warning);
|
||||||
if (diagLevel == TagParser::DiagLevel::Warning) {
|
if (diagLevel == TagParser::DiagLevel::Warning) {
|
||||||
|
@ -1212,7 +1212,7 @@ bool TagEditorWidget::startSaving()
|
||||||
* This private slot is invoked from the thread which performed the
|
* This private slot is invoked from the thread which performed the
|
||||||
* saving operation using Qt::QueuedConnection.
|
* saving operation using Qt::QueuedConnection.
|
||||||
*
|
*
|
||||||
* \param sucess Specifies whether the file could be saved sucessfully.
|
* \param success Specifies whether the file could be saved successfully.
|
||||||
*/
|
*/
|
||||||
void TagEditorWidget::showSavingResult(QString ioError, bool processingError, bool canceled)
|
void TagEditorWidget::showSavingResult(QString ioError, bool processingError, bool canceled)
|
||||||
{
|
{
|
||||||
|
@ -1275,11 +1275,11 @@ void TagEditorWidget::showSavingResult(QString ioError, bool processingError, bo
|
||||||
}
|
}
|
||||||
m_nextFileAfterSaving = false;
|
m_nextFileAfterSaving = false;
|
||||||
} else {
|
} else {
|
||||||
// fatal errors occured
|
// fatal errors occurred
|
||||||
|
|
||||||
// -> show status
|
// -> show status
|
||||||
static const QString processingErrorMsg = tr("The tags could not be saved. Checkout the info box for details.");
|
static const QString processingErrorMsg = tr("The tags could not be saved. Checkout the info box for details.");
|
||||||
static const QString ioErrorMsg = tr("The tags could not be saved because an IO error occured: %1");
|
static const QString ioErrorMsg = tr("The tags could not be saved because an IO error occurred: %1");
|
||||||
const auto errorMsg = !ioError.isEmpty() ? ioErrorMsg.arg(ioError) : processingErrorMsg;
|
const auto errorMsg = !ioError.isEmpty() ? ioErrorMsg.arg(ioError) : processingErrorMsg;
|
||||||
auto msgBox = new QMessageBox(this);
|
auto msgBox = new QMessageBox(this);
|
||||||
msgBox->setIcon(QMessageBox::Critical);
|
msgBox->setIcon(QMessageBox::Critical);
|
||||||
|
|
|
@ -732,7 +732,7 @@ QAction *TagFieldEdit::setupRestoreAction()
|
||||||
m_restoreAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
|
m_restoreAction->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
|
||||||
m_restoreAction->setToolTip(tr("Restore value as it is currently present in the file"));
|
m_restoreAction->setToolTip(tr("Restore value as it is currently present in the file"));
|
||||||
connect(m_restoreAction, &QAction::triggered, this, &TagFieldEdit::handleRestoreButtonClicked);
|
connect(m_restoreAction, &QAction::triggered, this, &TagFieldEdit::handleRestoreButtonClicked);
|
||||||
// ownership might be transfered to a child widget/layout
|
// ownership might be transferred to a child widget/layout
|
||||||
connect(m_restoreAction, &QAction::destroyed, this, &TagFieldEdit::handleRestoreButtonDestroyed);
|
connect(m_restoreAction, &QAction::destroyed, this, &TagFieldEdit::handleRestoreButtonDestroyed);
|
||||||
return m_restoreAction;
|
return m_restoreAction;
|
||||||
}
|
}
|
||||||
|
@ -749,7 +749,7 @@ QAction *TagFieldEdit::setupLockAction()
|
||||||
m_lockAction = new QAction(this);
|
m_lockAction = new QAction(this);
|
||||||
setLocked(!m_isLocked);
|
setLocked(!m_isLocked);
|
||||||
connect(m_lockAction, &QAction::triggered, this, &TagFieldEdit::toggleLocked);
|
connect(m_lockAction, &QAction::triggered, this, &TagFieldEdit::toggleLocked);
|
||||||
// ownership might be transfered to a child widget/layout
|
// ownership might be transferred to a child widget/layout
|
||||||
connect(m_lockAction, &QAction::destroyed, this, &TagFieldEdit::handleLockButtonDestroyed);
|
connect(m_lockAction, &QAction::destroyed, this, &TagFieldEdit::handleLockButtonDestroyed);
|
||||||
return m_lockAction;
|
return m_lockAction;
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,7 @@ TAGEDITOR_JS_VALUE TagEditorObject::parseFileInfo(const QString &fileName)
|
||||||
try {
|
try {
|
||||||
fileInfo.parseEverything(diag, progress);
|
fileInfo.parseEverything(diag, progress);
|
||||||
} catch (const Failure &) {
|
} catch (const Failure &) {
|
||||||
// parsing notifications will be addded anyways
|
// parsing notifications will be added anyways
|
||||||
criticalParseingErrorOccured = true;
|
criticalParseingErrorOccured = true;
|
||||||
} catch (const std::ios_base::failure &) {
|
} catch (const std::ios_base::failure &) {
|
||||||
criticalParseingErrorOccured = true;
|
criticalParseingErrorOccured = true;
|
||||||
|
|
Loading…
Reference in New Issue