diff --git a/sources/ElementsCollection/elementcollectionitem.cpp b/sources/ElementsCollection/elementcollectionitem.cpp index 84bdad4b3..210e75768 100644 --- a/sources/ElementsCollection/elementcollectionitem.cpp +++ b/sources/ElementsCollection/elementcollectionitem.cpp @@ -164,7 +164,7 @@ int ElementCollectionItem::rowForInsertItem(const QString &collection_name) if (eci->collectionName() > collection_name) return indexOfChild(eci); - return childCount(); + return (indexOfChild(child.last())+1); } /** diff --git a/sources/ElementsCollection/elementlocation.cpp b/sources/ElementsCollection/elementlocation.cpp index da577c528..711e38590 100644 --- a/sources/ElementsCollection/elementlocation.cpp +++ b/sources/ElementsCollection/elementlocation.cpp @@ -167,13 +167,13 @@ bool ElementLocation::setPath(QString path) m_file_system_path = path; if (path.startsWith(QETApp::commonElementsDirN())) { - path.remove(QETApp::commonElementsDirN() + "/"); + path.remove(QETApp::commonElementsDirN()+="/"); path.prepend("common://"); m_collection_path = path; } else if (path.startsWith(QETApp::customElementsDirN())) { - path.remove(QETApp::customElementsDirN() + "/"); + path.remove(QETApp::customElementsDirN()+="/"); path.prepend("custom://"); m_collection_path = path; } @@ -184,13 +184,13 @@ bool ElementLocation::setPath(QString path) m_file_system_path = path; if (path.startsWith(QETApp::commonElementsDirN())) { - path.remove(QETApp::commonElementsDirN() + "/"); + path.remove(QETApp::commonElementsDirN()+="/"); path.prepend("common://"); m_collection_path = path; } else if (path.startsWith(QETApp::customElementsDirN())) { - path.remove(QETApp::customElementsDirN()) + "/"; + path.remove(QETApp::customElementsDirN()+="/"); path.prepend("custom://"); m_collection_path = path; } diff --git a/sources/ElementsCollection/fileelementcollectionitem.h b/sources/ElementsCollection/fileelementcollectionitem.h index e3f7e756e..a53d2a448 100644 --- a/sources/ElementsCollection/fileelementcollectionitem.h +++ b/sources/ElementsCollection/fileelementcollectionitem.h @@ -64,9 +64,6 @@ class FileElementCollectionItem : public ElementCollectionItem private: void setPathName(QString path_name); void populate(); -// bool handleElementDrop (const QMimeData *data); -// bool handleDirectoryDrop (const QMimeData *data); -// bool createSubDir (QDir dir_to_copy, QDir destination); private: QString m_path;