diff options
author | Uwe Klotz <uwe_klotz@web.de> | 2017-01-28 10:30:03 +0100 |
---|---|---|
committer | Uwe Klotz <uwe_klotz@web.de> | 2017-01-28 10:30:03 +0100 |
commit | e19e49d3e732c9f0a3cfb1b1f8deba024fff1326 (patch) | |
tree | 681bc2728667cde4da41c9d31ddd0280821199ae /src/library | |
parent | 2055c37b19f58aefdc2ff6ace1d1b75023ab44ce (diff) |
Rename debug assertion macro
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/autodj/autodjprocessor.cpp | 8 | ||||
-rw-r--r-- | src/library/autodj/dlgautodj.cpp | 2 | ||||
-rw-r--r-- | src/library/baseplaylistfeature.cpp | 2 | ||||
-rw-r--r-- | src/library/basesqltablemodel.cpp | 4 | ||||
-rw-r--r-- | src/library/dao/cuedao.cpp | 2 | ||||
-rw-r--r-- | src/library/dao/trackdao.cpp | 18 | ||||
-rw-r--r-- | src/library/dlganalysis.cpp | 2 | ||||
-rw-r--r-- | src/library/dlghidden.cpp | 2 | ||||
-rw-r--r-- | src/library/dlgmissing.cpp | 2 | ||||
-rw-r--r-- | src/library/export/trackexportdlg.cpp | 2 | ||||
-rw-r--r-- | src/library/library.cpp | 4 | ||||
-rw-r--r-- | src/library/proxytrackmodel.cpp | 2 | ||||
-rw-r--r-- | src/library/recording/dlgrecording.cpp | 2 | ||||
-rw-r--r-- | src/library/scanner/libraryscanner.cpp | 4 | ||||
-rw-r--r-- | src/library/schemamanager.cpp | 6 | ||||
-rw-r--r-- | src/library/searchquery.cpp | 2 | ||||
-rw-r--r-- | src/library/sidebarmodel.cpp | 2 | ||||
-rw-r--r-- | src/library/trackcollection.cpp | 4 |
18 files changed, 35 insertions, 35 deletions
diff --git a/src/library/autodj/autodjprocessor.cpp b/src/library/autodj/autodjprocessor.cpp index 8932e6d179..e9b3c642dd 100644 --- a/src/library/autodj/autodjprocessor.cpp +++ b/src/library/autodj/autodjprocessor.cpp @@ -180,7 +180,7 @@ AutoDJProcessor::AutoDJError AutoDJProcessor::shufflePlaylist( void AutoDJProcessor::fadeNow() { // Auto-DJ needs at least two decks - DEBUG_ASSERT_AND_HANDLE(m_decks.length() > 1) { + VERIFY_OR_DEBUG_ASSERT(m_decks.length() > 1) { return; } if (m_eState != ADJ_IDLE) { @@ -221,7 +221,7 @@ AutoDJProcessor::AutoDJError AutoDJProcessor::skipNext() { } // Auto-DJ needs at least two decks - DEBUG_ASSERT_AND_HANDLE(m_decks.length() > 1) { + VERIFY_OR_DEBUG_ASSERT(m_decks.length() > 1) { return ADJ_NOT_TWO_DECKS; } @@ -405,7 +405,7 @@ void AutoDJProcessor::playerPositionChanged(DeckAttributes* pAttributes, } // Auto-DJ needs at least two decks - DEBUG_ASSERT_AND_HANDLE(m_decks.length() > 1) { + VERIFY_OR_DEBUG_ASSERT(m_decks.length() > 1) { return; } @@ -830,7 +830,7 @@ void AutoDJProcessor::setTransitionTime(int time) { } // Auto-DJ needs at least two decks - DEBUG_ASSERT_AND_HANDLE(m_decks.length() > 1) { + VERIFY_OR_DEBUG_ASSERT(m_decks.length() > 1) { return; } diff --git a/src/library/autodj/dlgautodj.cpp b/src/library/autodj/dlgautodj.cpp index 5ed512d8bf..3d524826f1 100644 --- a/src/library/autodj/dlgautodj.cpp +++ b/src/library/autodj/dlgautodj.cpp @@ -38,7 +38,7 @@ DlgAutoDJ::DlgAutoDJ(QWidget* parent, QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout()); - DEBUG_ASSERT_AND_HANDLE(box) { //Assumes the form layout is a QVBox/QHBoxLayout! + VERIFY_OR_DEBUG_ASSERT(box) { //Assumes the form layout is a QVBox/QHBoxLayout! } else { box->removeWidget(m_pTrackTablePlaceholder); m_pTrackTablePlaceholder->hide(); diff --git a/src/library/baseplaylistfeature.cpp b/src/library/baseplaylistfeature.cpp index 16d2552119..638c6a31f1 100644 --- a/src/library/baseplaylistfeature.cpp +++ b/src/library/baseplaylistfeature.cpp @@ -324,7 +324,7 @@ void BasePlaylistFeature::slotDeletePlaylist() { } if (m_lastRightClickedIndex.isValid()) { - DEBUG_ASSERT_AND_HANDLE(playlistId >= 0) { + VERIFY_OR_DEBUG_ASSERT(playlistId >= 0) { return; } diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp index a4e2012487..d0e7169267 100644 --- a/src/library/basesqltablemodel.cpp +++ b/src/library/basesqltablemodel.cpp @@ -542,7 +542,7 @@ void BaseSqlTableModel::setSort(int column, Qt::SortOrder order) { int ccColumn = sc.m_column - m_tableColumns.size() + 1; sort_field = m_trackSource->columnSortForFieldIndex(ccColumn); } - DEBUG_ASSERT_AND_HANDLE(!sort_field.isEmpty()) { + VERIFY_OR_DEBUG_ASSERT(!sort_field.isEmpty()) { continue; } @@ -953,7 +953,7 @@ void BaseSqlTableModel::setTrackValueForColumn(TrackPointer pTrack, int column, pTrack->setBpmLocked(value.toBool()); } else { // We never should get up to this point! - DEBUG_ASSERT_AND_HANDLE(false) { + VERIFY_OR_DEBUG_ASSERT(false) { qWarning() << "Column" << m_tableColumnCache.columnNameForFieldIndex(column) << "is not editable!"; diff --git a/src/library/dao/cuedao.cpp b/src/library/dao/cuedao.cpp index f6bc080305..d45f28cd32 100644 --- a/src/library/dao/cuedao.cpp +++ b/src/library/dao/cuedao.cpp @@ -143,7 +143,7 @@ bool CueDAO::deleteCuesForTracks(const QList<TrackId>& trackIds) { bool CueDAO::saveCue(Cue* cue) { //qDebug() << "CueDAO::saveCue" << QThread::currentThread() << m_database.connectionName(); - DEBUG_ASSERT_AND_HANDLE(cue) { + VERIFY_OR_DEBUG_ASSERT(cue) { return false; } if (cue->getId() == -1) { diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 86286fa3a0..101934e1b0 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -288,7 +288,7 @@ void TrackDAO::saveTrack(Track* pTrack) { void TrackDAO::slotTrackDirty(Track* pTrack) { // Should not be possible. - DEBUG_ASSERT_AND_HANDLE(pTrack != nullptr) { + VERIFY_OR_DEBUG_ASSERT(pTrack != nullptr) { return; } @@ -308,7 +308,7 @@ void TrackDAO::slotTrackDirty(Track* pTrack) { void TrackDAO::slotTrackClean(Track* pTrack) { // Should not be possible. - DEBUG_ASSERT_AND_HANDLE(pTrack != nullptr) { + VERIFY_OR_DEBUG_ASSERT(pTrack != nullptr) { return; } @@ -343,7 +343,7 @@ void TrackDAO::databaseTracksChanged(QSet<TrackId> tracksChanged) { void TrackDAO::slotTrackChanged(Track* pTrack) { // Should not be possible. - DEBUG_ASSERT_AND_HANDLE(pTrack != nullptr) { + VERIFY_OR_DEBUG_ASSERT(pTrack != nullptr) { return; } @@ -553,7 +553,7 @@ namespace { TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) { DEBUG_ASSERT(pTrack); - DEBUG_ASSERT_AND_HANDLE(m_pQueryLibraryInsert || m_pQueryTrackLocationInsert || + VERIFY_OR_DEBUG_ASSERT(m_pQueryLibraryInsert || m_pQueryTrackLocationInsert || m_pQueryLibrarySelect || m_pQueryTrackLocationSelect) { qDebug() << "TrackDAO::addTracksAddTrack: needed SqlQuerys have not " "been prepared. Skipping track" @@ -642,7 +642,7 @@ TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) { // track location into the table AND we could not retrieve the id of // that track location from the same table. "It shouldn't // happen"... unless I screwed up - Albert :) - DEBUG_ASSERT_AND_HANDLE(trackLocationId.isValid()) { + VERIFY_OR_DEBUG_ASSERT(trackLocationId.isValid()) { return TrackId(); } @@ -650,7 +650,7 @@ TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) { return TrackId(); } trackId = TrackId(m_pQueryLibraryInsert->lastInsertId()); - DEBUG_ASSERT_AND_HANDLE(trackId.isValid()) { + VERIFY_OR_DEBUG_ASSERT(trackId.isValid()) { return TrackId(); } @@ -984,7 +984,7 @@ void TrackDAO::purgeTracks(const QList<TrackId>& trackIds) { void TrackDAO::slotTrackReferenceExpired(Track* pTrack) { // Should not be possible. - DEBUG_ASSERT_AND_HANDLE(pTrack != nullptr) { + VERIFY_OR_DEBUG_ASSERT(pTrack != nullptr) { return; } @@ -1341,7 +1341,7 @@ TrackPointer TrackDAO::getTrackFromDB(TrackId trackId) const { QSqlRecord queryRecord = query.record(); int recordCount = queryRecord.count(); - DEBUG_ASSERT_AND_HANDLE(recordCount == columnsCount) { + VERIFY_OR_DEBUG_ASSERT(recordCount == columnsCount) { recordCount = math_min(recordCount, columnsCount); } @@ -1985,7 +1985,7 @@ void TrackDAO::detectCoverArtForTracksWithoutCover(volatile const bool* pCancel, CoverInfo::Source source = static_cast<CoverInfo::Source>( query.value(4).toInt()); - DEBUG_ASSERT_AND_HANDLE(source != CoverInfo::USER_SELECTED) { + VERIFY_OR_DEBUG_ASSERT(source != CoverInfo::USER_SELECTED) { qWarning() << "PROGRAMMING ERROR! detectCoverArtForTracksWithoutCover()" << "got a USER_SELECTED track. Skipping."; continue; diff --git a/src/library/dlganalysis.cpp b/src/library/dlganalysis.cpp index 56ea621766..4c07e30a42 100644 --- a/src/library/dlganalysis.cpp +++ b/src/library/dlganalysis.cpp @@ -30,7 +30,7 @@ DlgAnalysis::DlgAnalysis(QWidget* parent, this, SIGNAL(trackSelected(TrackPointer))); QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout()); - DEBUG_ASSERT_AND_HANDLE(box) { // Assumes the form layout is a QVBox/QHBoxLayout! + VERIFY_OR_DEBUG_ASSERT(box) { // Assumes the form layout is a QVBox/QHBoxLayout! } else { box->removeWidget(m_pTrackTablePlaceholder); m_pTrackTablePlaceholder->hide(); diff --git a/src/library/dlghidden.cpp b/src/library/dlghidden.cpp index 5335f5baa2..dda58b0893 100644 --- a/src/library/dlghidden.cpp +++ b/src/library/dlghidden.cpp @@ -17,7 +17,7 @@ DlgHidden::DlgHidden(QWidget* parent, UserSettingsPointer pConfig, // Install our own trackTable QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout()); - DEBUG_ASSERT_AND_HANDLE(box) { //Assumes the form layout is a QVBox/QHBoxLayout! + VERIFY_OR_DEBUG_ASSERT(box) { //Assumes the form layout is a QVBox/QHBoxLayout! } else { box->removeWidget(m_pTrackTablePlaceholder); m_pTrackTablePlaceholder->hide(); diff --git a/src/library/dlgmissing.cpp b/src/library/dlgmissing.cpp index e5207b4d44..5eeca8dec8 100644 --- a/src/library/dlgmissing.cpp +++ b/src/library/dlgmissing.cpp @@ -16,7 +16,7 @@ DlgMissing::DlgMissing(QWidget* parent, UserSettingsPointer pConfig, // Install our own trackTable QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout()); - DEBUG_ASSERT_AND_HANDLE(box) { //Assumes the form layout is a QVBox/QHBoxLayout! + VERIFY_OR_DEBUG_ASSERT(box) { //Assumes the form layout is a QVBox/QHBoxLayout! } else { box->removeWidget(m_pTrackTablePlaceholder); m_pTrackTablePlaceholder->hide(); diff --git a/src/library/export/trackexportdlg.cpp b/src/library/export/trackexportdlg.cpp index 4efcf5ca45..f17e509203 100644 --- a/src/library/export/trackexportdlg.cpp +++ b/src/library/export/trackexportdlg.cpp @@ -32,7 +32,7 @@ TrackExportDlg::TrackExportDlg(QWidget *parent, void TrackExportDlg::showEvent(QShowEvent* event) { QDialog::showEvent(event); - DEBUG_ASSERT_AND_HANDLE(m_worker) { + VERIFY_OR_DEBUG_ASSERT(m_worker) { // It's not worth checking for m_exporter != nullptr elsewhere in this // class... it'll be clear very quickly that someone screwed up and // forgot to call selectDestinationDirectory(). diff --git a/src/library/library.cpp b/src/library/library.cpp index 8d8d3548cf..41e636af47 100644 --- a/src/library/library.cpp +++ b/src/library/library.cpp @@ -220,7 +220,7 @@ void Library::bindWidget(WLibrary* pLibraryWidget, } void Library::addFeature(LibraryFeature* feature) { - DEBUG_ASSERT_AND_HANDLE(feature) { + VERIFY_OR_DEBUG_ASSERT(feature) { return; } m_features.push_back(feature); @@ -244,7 +244,7 @@ void Library::addFeature(LibraryFeature* feature) { void Library::slotShowTrackModel(QAbstractItemModel* model) { //qDebug() << "Library::slotShowTrackModel" << model; TrackModel* trackModel = dynamic_cast<TrackModel*>(model); - DEBUG_ASSERT_AND_HANDLE(trackModel) { + VERIFY_OR_DEBUG_ASSERT(trackModel) { return; } emit(showTrackModel(model)); diff --git a/src/library/proxytrackmodel.cpp b/src/library/proxytrackmodel.cpp index 9c12a199c7..31e50011c4 100644 --- a/src/library/proxytrackmodel.cpp +++ b/src/library/proxytrackmodel.cpp @@ -14,7 +14,7 @@ ProxyTrackModel::ProxyTrackModel(QAbstractItemModel* pTrackModel, m_pTrackModel(dynamic_cast<TrackModel*>(pTrackModel)), m_currentSearch(""), m_bHandleSearches(bHandleSearches) { - DEBUG_ASSERT_AND_HANDLE(m_pTrackModel && pTrackModel) { + VERIFY_OR_DEBUG_ASSERT(m_pTrackModel && pTrackModel) { return; } setSourceModel(pTrackModel); diff --git a/src/library/recording/dlgrecording.cpp b/src/library/recording/dlgrecording.cpp index 0a6ea5c14a..d55326b90c 100644 --- a/src/library/recording/dlgrecording.cpp +++ b/src/library/recording/dlgrecording.cpp @@ -40,7 +40,7 @@ DlgRecording::DlgRecording(QWidget* parent, UserSettingsPointer pConfig, this, SLOT(slotDurationRecorded(QString))); QBoxLayout* box = dynamic_cast<QBoxLayout*>(layout()); - DEBUG_ASSERT_AND_HANDLE(box) { //Assumes the form layout is a QVBox/QHBoxLayout! + VERIFY_OR_DEBUG_ASSERT(box) { //Assumes the form layout is a QVBox/QHBoxLayout! } else { box->removeWidget(m_pTrackTablePlaceholder); m_pTrackTablePlaceholder->hide(); diff --git a/src/library/scanner/libraryscanner.cpp b/src/library/scanner/libraryscanner.cpp index 6c1360b758..47fe0fabee 100644 --- a/src/library/scanner/libraryscanner.cpp +++ b/src/library/scanner/libraryscanner.cpp @@ -234,7 +234,7 @@ void LibraryScanner::slotStartScan() { // is called when all tasks of the first stage are done (threads are finished) void LibraryScanner::slotFinishHashedScan() { qDebug() << "LibraryScanner::slotFinishHashedScan"; - DEBUG_ASSERT_AND_HANDLE(!m_scannerGlobal.isNull()) { + VERIFY_OR_DEBUG_ASSERT(!m_scannerGlobal.isNull()) { qWarning() << "No scanner global state exists in LibraryScanner::slotFinishHashedScan"; return; } @@ -348,7 +348,7 @@ void LibraryScanner::cleanUpScan() { // is called when all tasks of the second stage are done (threads are finished) void LibraryScanner::slotFinishUnhashedScan() { qDebug() << "LibraryScanner::slotFinishUnhashedScan"; - DEBUG_ASSERT_AND_HANDLE(!m_scannerGlobal.isNull()) { + VERIFY_OR_DEBUG_ASSERT(!m_scannerGlobal.isNull()) { qWarning() << "No scanner global state exists in LibraryScanner::slotFinishUnhashedScan"; return; } diff --git a/src/library/schemamanager.cpp b/src/library/schemamanager.cpp index 1518ebf947..057bfe3be1 100644 --- a/src/library/schemamanager.cpp +++ b/src/library/schemamanager.cpp @@ -17,7 +17,7 @@ SchemaManager::Result SchemaManager::upgradeToSchemaVersion( QSqlDatabase& db, const int targetVersion) { SettingsDAO settings(db); int currentVersion = getCurrentSchemaVersion(settings); - DEBUG_ASSERT_AND_HANDLE(currentVersion >= 0) { + VERIFY_OR_DEBUG_ASSERT(currentVersion >= 0) { return RESULT_UPGRADE_FAILED; } @@ -58,7 +58,7 @@ SchemaManager::Result SchemaManager::upgradeToSchemaVersion( for (int i = 0; i < revisions.count(); i++) { QDomElement revision = revisions.at(i).toElement(); QString version = revision.attribute("version"); - DEBUG_ASSERT_AND_HANDLE(!version.isNull()) { + VERIFY_OR_DEBUG_ASSERT(!version.isNull()) { // xml file is not valid return RESULT_SCHEMA_ERROR; } @@ -92,7 +92,7 @@ SchemaManager::Result SchemaManager::upgradeToSchemaVersion( minCompatibleVersion = QString::number(thisTarget); } - DEBUG_ASSERT_AND_HANDLE(!eSql.isNull()) { + VERIFY_OR_DEBUG_ASSERT(!eSql.isNull()) { // xml file is not valid return RESULT_SCHEMA_ERROR; } diff --git a/src/library/searchquery.cpp b/src/library/searchquery.cpp index d4e10b7b5c..cd2364be5c 100644 --- a/src/library/searchquery.cpp +++ b/src/library/searchquery.cpp @@ -98,7 +98,7 @@ QString AndNode::toSql() const { bool OrNode::match(const TrackPointer& pTrack) const { // An empty OR node would always evaluate to false // which is inconsistent with the generated SQL query! - DEBUG_ASSERT_AND_HANDLE(!m_nodes.empty()) { + VERIFY_OR_DEBUG_ASSERT(!m_nodes.empty()) { // Evaluate to true even if the correct choice would // be false to keep the evaluation consistent with // the generated SQL query. diff --git a/src/library/sidebarmodel.cpp b/src/library/sidebarmodel.cpp index cc86a1bd77..90423529d1 100644 --- a/src/library/sidebarmodel.cpp +++ b/src/library/sidebarmodel.cpp @@ -315,7 +315,7 @@ QModelIndex SidebarModel::translateSourceIndex(const QModelIndex& index) { */ const QAbstractItemModel* model = dynamic_cast<QAbstractItemModel*>(sender()); - DEBUG_ASSERT_AND_HANDLE(model != NULL) { + VERIFY_OR_DEBUG_ASSERT(model != NULL) { return QModelIndex(); } diff --git a/src/library/trackcollection.cpp b/src/library/trackcollection.cpp index 1af6d52ebb..673e5d13e5 100644 --- a/src/library/trackcollection.cpp +++ b/src/library/trackcollection.cpp @@ -157,7 +157,7 @@ QSharedPointer<BaseTrackCache> TrackCollection::getTrackSource() { } void TrackCollection::setTrackSource(QSharedPointer<BaseTrackCache> trackSource) { - DEBUG_ASSERT_AND_HANDLE(m_defaultTrackSource.isNull()) { + VERIFY_OR_DEBUG_ASSERT(m_defaultTrackSource.isNull()) { return; } m_defaultTrackSource = trackSource; @@ -254,7 +254,7 @@ int TrackCollection::sqliteLocaleAwareCompare(void* pArg, void TrackCollection::sqliteLike(sqlite3_context *context, int aArgc, sqlite3_value **aArgv) { - DEBUG_ASSERT_AND_HANDLE(aArgc == 2 || aArgc == 3) { + VERIFY_OR_DEBUG_ASSERT(aArgc == 2 || aArgc == 3) { return; } |