Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow-up: Move definition of library default columns out of header file #3465

Merged
merged 1 commit into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 1 addition & 39 deletions src/library/dao/trackschema.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef MIXXX_TRACKSCHEMA_H
#define MIXXX_TRACKSCHEMA_H
#pragma once

#include <QString>
#include <QStringList>

#define LIBRARY_TABLE "library"
#define TRACKLOCATIONS_TABLE "track_locations"
Expand Down Expand Up @@ -56,45 +54,9 @@ const QString TRACKLOCATIONSTABLE_NEEDSVERIFICATION = "needs_verification";

const QString REKORDBOX_ANALYZE_PATH = "analyze_path";

const QStringList DEFAULT_COLUMNS = {
LIBRARYTABLE_ID,
LIBRARYTABLE_PLAYED,
LIBRARYTABLE_TIMESPLAYED,
//has to be up here otherwise Played and TimesPlayed are not shown
LIBRARYTABLE_ALBUMARTIST,
LIBRARYTABLE_ALBUM,
LIBRARYTABLE_ARTIST,
LIBRARYTABLE_TITLE,
LIBRARYTABLE_YEAR,
LIBRARYTABLE_RATING,
LIBRARYTABLE_GENRE,
LIBRARYTABLE_COMPOSER,
LIBRARYTABLE_GROUPING,
LIBRARYTABLE_TRACKNUMBER,
LIBRARYTABLE_KEY,
LIBRARYTABLE_KEY_ID,
LIBRARYTABLE_BPM,
LIBRARYTABLE_BPM_LOCK,
LIBRARYTABLE_DURATION,
LIBRARYTABLE_BITRATE,
LIBRARYTABLE_REPLAYGAIN,
LIBRARYTABLE_FILETYPE,
LIBRARYTABLE_DATETIMEADDED,
TRACKLOCATIONSTABLE_LOCATION,
TRACKLOCATIONSTABLE_FSDELETED,
LIBRARYTABLE_COMMENT,
LIBRARYTABLE_MIXXXDELETED,
LIBRARYTABLE_COLOR,
LIBRARYTABLE_COVERART_SOURCE,
LIBRARYTABLE_COVERART_TYPE,
LIBRARYTABLE_COVERART_LOCATION,
LIBRARYTABLE_COVERART_HASH};

namespace mixxx {
namespace trackschema {
// TableForColumn returns the name of the table that contains the named column.
QString tableForColumn(const QString& columnName);
} // namespace trackschema
} // namespace mixxx

#endif //MIXXX_TRACKSCHEMA_H
38 changes: 38 additions & 0 deletions src/library/mixxxlibraryfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,44 @@
#include "util/dnd.h"
#include "widget/wlibrary.h"

namespace {

const QStringList DEFAULT_COLUMNS = {
LIBRARYTABLE_ID,
LIBRARYTABLE_PLAYED,
LIBRARYTABLE_TIMESPLAYED,
//has to be up here otherwise Played and TimesPlayed are not shown
LIBRARYTABLE_ALBUMARTIST,
LIBRARYTABLE_ALBUM,
LIBRARYTABLE_ARTIST,
LIBRARYTABLE_TITLE,
LIBRARYTABLE_YEAR,
LIBRARYTABLE_RATING,
LIBRARYTABLE_GENRE,
LIBRARYTABLE_COMPOSER,
LIBRARYTABLE_GROUPING,
LIBRARYTABLE_TRACKNUMBER,
LIBRARYTABLE_KEY,
LIBRARYTABLE_KEY_ID,
LIBRARYTABLE_BPM,
LIBRARYTABLE_BPM_LOCK,
LIBRARYTABLE_DURATION,
LIBRARYTABLE_BITRATE,
LIBRARYTABLE_REPLAYGAIN,
LIBRARYTABLE_FILETYPE,
LIBRARYTABLE_DATETIMEADDED,
TRACKLOCATIONSTABLE_LOCATION,
TRACKLOCATIONSTABLE_FSDELETED,
LIBRARYTABLE_COMMENT,
LIBRARYTABLE_MIXXXDELETED,
LIBRARYTABLE_COLOR,
LIBRARYTABLE_COVERART_SOURCE,
LIBRARYTABLE_COVERART_TYPE,
LIBRARYTABLE_COVERART_LOCATION,
LIBRARYTABLE_COVERART_HASH};

} // namespace

MixxxLibraryFeature::MixxxLibraryFeature(Library* pLibrary,
UserSettingsPointer pConfig)
: LibraryFeature(pLibrary, pConfig),
Expand Down