From 0f0dbfb0395810c1c205a1dc10cf1f226669fd00 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 15 Sep 2008 21:43:21 +0000 Subject: [FIX] Copy and pasting in the tree works better now [FIX] Drag and dropped touched up git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@264 6ecfd1a5-f3ed-3746-8530-beee90d26b22 --- sigmodr/SigmodTreeModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sigmodr/SigmodTreeModel.cpp') diff --git a/sigmodr/SigmodTreeModel.cpp b/sigmodr/SigmodTreeModel.cpp index 1e01db61..f4288e1c 100644 --- a/sigmodr/SigmodTreeModel.cpp +++ b/sigmodr/SigmodTreeModel.cpp @@ -130,7 +130,7 @@ QStringList Sigmodr::SigmodTreeModel::mimeTypes() const QMimeData* Sigmodr::SigmodTreeModel::mimeData(const QModelIndexList& indexes) const { - QMimeData *mimeData = new QMimeData(); + QMimeData *mimeData = new QMimeData; if ((indexes.size() == 1) && indexes[0].isValid()) { QDomDocument xml; @@ -146,10 +146,10 @@ bool Sigmodr::SigmodTreeModel::dropMimeData(const QMimeData* data, Qt::DropActio return true; if (!data->hasFormat("application/x-sigmod+xml")) return false; + bool success; if (parent.isValid()) - return setData(parent, data->data("application/x-sigmod+xml"), Sigmodr::BaseModel::XmlRole); emit(layoutAboutToBeChanged()); - bool success = m_root->setData(data->data("application/x-sigmod+xml"), Sigmodr::BaseModel::XmlRole); + success = parent.isValid() ? setData(parent, data->data("application/x-sigmod+xml"), Sigmodr::BaseModel::XmlRole) : m_root->setData(data->data("application/x-sigmod+xml"), Sigmodr::BaseModel::XmlRole); emit(layoutChanged()); if (success) emit(dirty(findSigmod(parent), true)); -- cgit