From 4327820c425525a39253970c219a7dfe3014e94c Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Tue, 16 Sep 2008 14:02:02 +0000 Subject: [PATCH] print name of object which uses ID if another object requests it git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1614 0778d3d1-df1d-0410-868b-ea421aaaa00d --- src/core/journalling_object.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/core/journalling_object.cpp b/src/core/journalling_object.cpp index 36a685a48..2d42370d1 100644 --- a/src/core/journalling_object.cpp +++ b/src/core/journalling_object.cpp @@ -28,6 +28,7 @@ #include #include "journalling_object.h" +#include "automatable_model.h" #include "project_journal.h" #include "base64.h" #include "engine.h" @@ -142,11 +143,20 @@ void journallingObject::changeID( jo_id_t _id ) { if( id() != _id ) { - if( engine::getProjectJournal()->getJournallingObject( _id ) - != NULL ) + journallingObject * jo = engine::getProjectJournal()-> + getJournallingObject( _id ); + if( jo != NULL ) { - printf( "JO-ID %d already in use by another " - "object!\n", _id ); + QString used_by = jo->nodeName(); + if( used_by == "automatablemodel" && + dynamic_cast( jo ) ) + { + used_by += ":" + + dynamic_cast( jo )-> + displayName(); + } + printf( "JO-ID %d already in use by %s!\n", _id, + used_by.toAscii().constData() ); return; } engine::getProjectJournal()->forgetAboutID( id() );