Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergAtGithub committed Sep 24, 2023
1 parent 6e43d32 commit a3f9ab9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/library/export/trackexportworker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ QMap<QString, mixxx::FileInfo> TrackExportWorker::createCopylist(const TrackPoin
const auto fileName = fileInfo.fileName();
QString destFileName = generateFilename(pTrack, index, 0);
if (destFileName.isEmpty()) {
//qWarning() << "pattern generated empty filename for:" << it;
// qWarning() << "pattern generated empty filename for:" << it;
skippedTracks->append(pTrack);
continue;
}
Expand Down
34 changes: 17 additions & 17 deletions src/library/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,27 +182,27 @@ bool Parser::exportPlaylistItemsIntoFile(
playlistItemLocations,
useRelativePath);
} else {
//default export to M3U if file extension is missing
// default export to M3U if file extension is missing
if (!playlistFilePath.endsWith(
QStringLiteral(".m3u"),
Qt::CaseInsensitive)) {
kLogger.debug()
<< "No valid file extension for playlist export specified."
<< "Appending .m3u and exporting to M3U.";
playlistFilePath.append(QStringLiteral(".m3u"));
if (QFileInfo::exists(playlistFilePath)) {
auto overwrite = QMessageBox::question(nullptr,
QObject::tr("Overwrite File?"),
QObject::tr("A playlist file with the name \"%1\" "
"already exists.\n"
"The default \"m3u\" extension was added "
"because none was specified.\n\n"
"Do you really want to overwrite it?")
.arg(playlistFilePath));
if (overwrite != QMessageBox::StandardButton::Yes) {
return false;
kLogger.debug()
<< "No valid file extension for playlist export specified."
<< "Appending .m3u and exporting to M3U.";
playlistFilePath.append(QStringLiteral(".m3u"));
if (QFileInfo::exists(playlistFilePath)) {
auto overwrite = QMessageBox::question(nullptr,
QObject::tr("Overwrite File?"),
QObject::tr("A playlist file with the name \"%1\" "
"already exists.\n"
"The default \"m3u\" extension was added "
"because none was specified.\n\n"
"Do you really want to overwrite it?")
.arg(playlistFilePath));
if (overwrite != QMessageBox::StandardButton::Yes) {
return false;
}
}
}
}
return ParserM3u::writeM3UFile(
playlistFilePath,
Expand Down
6 changes: 3 additions & 3 deletions src/test/formatter_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TEST_F(FormatterTest, TestRangeGroupFilter) {
// Generate a file name for the temporary file
auto engine = Formatter::getEngine(nullptr);
auto context = new Context();
//context->insert("x1", "122");
// context->insert("x1", "122");
Template t1 = engine->newTemplate(QStringLiteral("{{143|rangegroup}}"), QStringLiteral("t1"));

auto pattern = t1->render(context);
Expand Down Expand Up @@ -59,7 +59,7 @@ TEST_F(FormatterTest, TestZeropadFilter) {
// Generate a file name for the temporary file
auto engine = Formatter::getEngine(nullptr);
auto context = new Context();
//context->insert("x1", "122");
// context->insert("x1", "122");
Template t1 = engine->newTemplate(QStringLiteral("{{1|zeropad}}"), QStringLiteral("t1"));

EXPECT_EQ(t1->render(context),
Expand All @@ -81,7 +81,7 @@ TEST_F(FormatterTest, TestRoundFilter) {
// Generate a file name for the temporary file
auto engine = Formatter::getEngine(nullptr);
auto context = new Context();
//context->insert("x1", "122");
// context->insert("x1", "122");
Template t1 = engine->newTemplate(QStringLiteral("{{x1|round}}"), QStringLiteral("t1"));
context->insert("x1", QVariant(1.49));
EXPECT_EQ(t1->render(context),
Expand Down
6 changes: 4 additions & 2 deletions src/util/fileutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#include <QRegularExpression>

namespace {
// see https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names
// Note, that the colon can be part of Windows paths starting with drive letters: C:
// see
// https://stackoverflow.com/questions/1976007/what-characters-are-forbidden-in-windows-and-linux-directory-names
// Note, that the colon can be part of Windows paths starting with drive
// letters: C:
const auto kIllegalCharacters = QRegularExpression("([<>:\"\\|\\?\\*]|[\x01-\x1F])");
const auto kDirChars = QRegularExpression("[/\\\\]");
} // namespace
Expand Down
3 changes: 2 additions & 1 deletion src/util/fileutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const QString kDefaultDirReplacementCharacter = QString("-");

class FileUtils {
public:
// returns a filename that is safe on all platforms and does not contain unwanted characters like newline
// returns a filename that is safe on all platforms and does not contain
// unwanted characters like newline
static QString safeFilename(const QString& input,
const QString& replacement = kDefaultFileReplacementCharacter);
static QString replaceDirChars(const QString& input,
Expand Down
2 changes: 1 addition & 1 deletion src/util/formatterplugin/mixxxformatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class ZeroPad : public Filter {
};
};

/// Rounds a double to n precission (default = 0)
/// Rounds a double to n precision (default = 0)
class Rounder : public Filter {
public:
Rounder(){};
Expand Down

0 comments on commit a3f9ab9

Please sign in to comment.