diff --git a/sources/ElementsCollection/fileelementcollectionitem.cpp b/sources/ElementsCollection/fileelementcollectionitem.cpp index d7305fef6..bf5fe767b 100644 --- a/sources/ElementsCollection/fileelementcollectionitem.cpp +++ b/sources/ElementsCollection/fileelementcollectionitem.cpp @@ -61,7 +61,8 @@ QString FileElementCollectionItem::fileSystemPath() const if (isCollectionRoot()) return m_path; - FileElementCollectionItem *feci = static_cast (parent()); + FileElementCollectionItem *feci = + static_cast (parent()); if (feci) return feci->fileSystemPath() + "/" + m_path; else @@ -129,7 +130,8 @@ QString FileElementCollectionItem::localName() pugi::xml_document docu; if(docu.load_file(str.toStdString().c_str())) { - if (QString(docu.document_element().name()) == "qet-directory") + if (QString(docu.document_element().name()) + == "qet-directory") { NamesList nl; nl.fromXml(docu.document_element()); @@ -192,8 +194,10 @@ QString FileElementCollectionItem::collectionPath() const else return "custom://"; } - else if (parent() && parent()->type() == FileElementCollectionItem::Type) { - ElementCollectionItem *eci = static_cast(parent()); + else if (parent() && parent()->type() + == FileElementCollectionItem::Type) { + ElementCollectionItem *eci = + static_cast(parent()); if (eci->isCollectionRoot()) return eci->collectionPath() + m_path; else @@ -209,7 +213,8 @@ QString FileElementCollectionItem::collectionPath() const */ bool FileElementCollectionItem::isCollectionRoot() const { - if (m_path == QETApp::commonElementsDirN() || m_path == QETApp::customElementsDirN()) + if (m_path == QETApp::commonElementsDirN() + || m_path == QETApp::customElementsDirN()) return true; else return false; @@ -259,11 +264,16 @@ void FileElementCollectionItem::setUpData() if (isDir()) { localName(); - setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | Qt::ItemIsEnabled); + setFlags(Qt::ItemIsSelectable + | Qt::ItemIsDragEnabled + | Qt::ItemIsDropEnabled + | Qt::ItemIsEnabled); } else { - setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled); + setFlags(Qt::ItemIsSelectable + | Qt::ItemIsDragEnabled + | Qt::ItemIsEnabled); //Set the local name and all informations of the element //in the data Qt::UserRole+1, these data will be use for search. @@ -340,7 +350,8 @@ void FileElementCollectionItem::populate(bool set_data, bool hide_element) QDir dir (fileSystemPath()); //Get all directory in this directory. - for(auto str : dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name)) + for(auto str : dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, + QDir::Name)) { FileElementCollectionItem *feci = new FileElementCollectionItem(); appendRow(feci); @@ -354,7 +365,8 @@ void FileElementCollectionItem::populate(bool set_data, bool hide_element) //Get all elmt file in this directory dir.setNameFilters(QStringList() << "*.elmt"); - for(auto str : dir.entryList(QDir::Files | QDir::NoDotAndDotDot, QDir::Name)) + for(auto str : dir.entryList(QDir::Files | QDir::NoDotAndDotDot, + QDir::Name)) { FileElementCollectionItem *feci = new FileElementCollectionItem(); appendRow(feci); diff --git a/sources/ElementsCollection/fileelementcollectionitem.h b/sources/ElementsCollection/fileelementcollectionitem.h index 910c9dd65..b5992bbeb 100644 --- a/sources/ElementsCollection/fileelementcollectionitem.h +++ b/sources/ElementsCollection/fileelementcollectionitem.h @@ -34,7 +34,9 @@ class FileElementCollectionItem : public ElementCollectionItem enum { Type = UserType+2 }; int type() const override { return Type;} - bool setRootPath(const QString& path, bool set_data = true, bool hide_element = false); + bool setRootPath(const QString& path, + bool set_data = true, + bool hide_element = false); QString fileSystemPath() const; QString dirPath() const; @@ -53,7 +55,9 @@ class FileElementCollectionItem : public ElementCollectionItem void setUpIcon() override; private: - void setPathName(const QString& path_name, bool set_data = true, bool hide_element = false); + void setPathName(const QString& path_name, + bool set_data = true, + bool hide_element = false); void populate(bool set_data = true, bool hide_element = false); private: diff --git a/sources/elementspanelwidget.h b/sources/elementspanelwidget.h index f9ecb9789..e1905621a 100644 --- a/sources/elementspanelwidget.h +++ b/sources/elementspanelwidget.h @@ -41,7 +41,17 @@ class ElementsPanelWidget : public QWidget { private: ElementsPanel *elements_panel; QAction *open_directory, *copy_path; - QAction *prj_activate, *prj_close, *prj_edit_prop, *prj_prop_diagram, *prj_add_diagram, *prj_del_diagram, *prj_move_diagram_up, *prj_move_diagram_top, *prj_move_diagram_down, *prj_move_diagram_upx10, *prj_move_diagram_downx10; + QAction *prj_activate, + *prj_close, + *prj_edit_prop, + *prj_prop_diagram, + *prj_add_diagram, + *prj_del_diagram, + *prj_move_diagram_up, + *prj_move_diagram_top, + *prj_move_diagram_down, + *prj_move_diagram_upx10, + *prj_move_diagram_downx10; QAction *tbt_add, *tbt_edit, *tbt_remove; QMenu *context_menu; QLineEdit *filter_textfield; @@ -87,7 +97,7 @@ class ElementsPanelWidget : public QWidget { void filterEdited(const QString &); protected: - void keyPressEvent (QKeyEvent *e) override; + void keyPressEvent (QKeyEvent *e) override; private: QString previous_filter_;