diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-09-15 21:43:21 +0000 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-09-15 21:43:21 +0000 |
| commit | 0f0dbfb0395810c1c205a1dc10cf1f226669fd00 (patch) | |
| tree | 20cea50f0c9bdfede9be29b71bbac15c18ec5230 /sigmodr/SigmodTreeModel.cpp | |
| parent | de1e4dc34ab030b468f5ce7cf567bacc5d749423 (diff) | |
| download | sigen-0f0dbfb0395810c1c205a1dc10cf1f226669fd00.tar.gz sigen-0f0dbfb0395810c1c205a1dc10cf1f226669fd00.tar.xz sigen-0f0dbfb0395810c1c205a1dc10cf1f226669fd00.zip | |
[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
Diffstat (limited to 'sigmodr/SigmodTreeModel.cpp')
| -rw-r--r-- | sigmodr/SigmodTreeModel.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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)); |
