Commit 5e094147 authored by Dirk Wilden's avatar Dirk Wilden

copyObject moved to loadsaveinterface

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5856 383ad7c9-94d9-4d36-a494-682f7c89f535
parent e19d71c0
...@@ -84,6 +84,8 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn ...@@ -84,6 +84,8 @@ class DataControlPlugin : public QObject, BaseInterface, ToolboxInterface, KeyIn
// LoadSaveInterface // LoadSaveInterface
void deleteObject( int _id ); void deleteObject( int _id );
void emptyObjectAdded( int _id ); void emptyObjectAdded( int _id );
void copyObject( int _oldId, int& _newId);
private slots : private slots :
// BaseInterface // BaseInterface
void pluginsInitialized(); void pluginsInitialized();
......
...@@ -125,14 +125,9 @@ int DataControlPlugin::getObject( QString _name ) { ...@@ -125,14 +125,9 @@ int DataControlPlugin::getObject( QString _name ) {
*/ */
int DataControlPlugin::copyObject( int objectId ) { int DataControlPlugin::copyObject( int objectId ) {
int newObject = PluginFunctions::copyObject( objectId ); int newObject;
if ( newObject == -1 ) emit copyObject( objectId, newObject );
std::cerr << "Unable to copy object" << std::endl;
else{
emit emptyObjectAdded(newObject);
emit updatedObject(newObject);
}
return newObject; return newObject;
} }
......
...@@ -142,15 +142,10 @@ void DataControlPlugin::slotCopy() { ...@@ -142,15 +142,10 @@ void DataControlPlugin::slotCopy() {
BaseObject* copyItem = model_->getItem( indexList[i] ); BaseObject* copyItem = model_->getItem( indexList[i] );
int newObject = PluginFunctions::copyObject(copyItem->id()); int newObject;
emit copyObject( copyItem->id(), newObject );
if ( newObject == -1 ) {
emit log(LOGERR, "Unable to copy object" );
continue;
} else {
emit emptyObjectAdded( newObject );
emit updatedObject( newObject );
}
} }
emit updateView(); emit updateView();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment