diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp index 2f898f395..05dbc47d3 100644 --- a/sources/elementspanel.cpp +++ b/sources/elementspanel.cpp @@ -77,20 +77,6 @@ ElementsPanel::ElementsPanel(QWidget *parent) : ElementsPanel::~ElementsPanel() { } -/** - Gere l'entree d'un drag'n drop. L'evenement est accepte si les donnees - fournies contiennent un type MIME representant une categorie ou un element - QET. - @param e QDragEnterEvent decrivant l'entree du drag'n drop -*/ -void ElementsPanel::dragEnterEvent(QDragEnterEvent *e) { - if (e -> mimeData() -> hasFormat("application/x-qet-category-uri")) { - e -> acceptProposedAction(); - } else if (e -> mimeData() -> hasFormat("application/x-qet-element-uri")) { - e -> acceptProposedAction(); - } -} - /** Gere le debut des drag'n drop @param supportedActions Les actions supportees @@ -181,20 +167,6 @@ QTreeWidgetItem *ElementsPanel::updateTemplateItem(QTreeWidgetItem *tb_template_ return(item); } -/** - @return true if \a item matches the current filter, false otherwise -*/ -bool ElementsPanel::matchesCurrentFilter(const QTreeWidgetItem *item) const { - if (!item) return(false); - - // no filter => we consider the item matches - if (filter_.isEmpty()) return(true); - - bool item_matches = item -> text(0).contains(filter_, Qt::CaseInsensitive); - - return(item_matches); -} - /** @return true if \a item matches the filter, false otherwise */ @@ -215,7 +187,6 @@ bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item, QString filter) c * @param reload_collections true for read all collections since their sources (files, projects ...) */ void ElementsPanel::reload(bool reload_collections) { - Q_UNUSED(reload_collections); QIcon system_icon(":/ico/16x16/qet.png"); diff --git a/sources/elementspanel.h b/sources/elementspanel.h index 25b186d54..81080c9af 100644 --- a/sources/elementspanel.h +++ b/sources/elementspanel.h @@ -66,10 +66,8 @@ class ElementsPanel : public GenericPanel { void ensureHierarchyIsVisible(const QList &); protected: - void dragEnterEvent(QDragEnterEvent *); void startDrag(Qt::DropActions); void startTitleBlockTemplateDrag(const TitleBlockTemplateLocation &); - bool matchesCurrentFilter(const QTreeWidgetItem *) const; bool matchesFilter(const QTreeWidgetItem *, QString) const; protected slots: @@ -85,7 +83,6 @@ class ElementsPanel : public GenericPanel { QSet projects_to_display_; ///< list of projects that have been added to this panel QTreeWidgetItem *common_tbt_collection_item_; ///< pointer to the item representing the common templates collection QTreeWidgetItem *custom_tbt_collection_item_; ///< pointer to the item representing the user templates collection - int loading_progress_; ///< used to track the loading progress of elements collections bool first_reload_; ///< used to distinguish the first time this panel is reloaded QString filter_; ///< Currently applied filter QStringList filter_list_; ///< Currently applied list of filter diff --git a/sources/elementspanelwidget.cpp b/sources/elementspanelwidget.cpp index 8965dc0be..2ed2c2056 100644 --- a/sources/elementspanelwidget.cpp +++ b/sources/elementspanelwidget.cpp @@ -45,7 +45,6 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) { // initialise les actions open_directory = new QAction(QET::Icons::DocumentOpen, tr("Ouvrir le dossier correspondant"), this); copy_path = new QAction(QET::Icons::IC_CopyFile, tr("Copier le chemin"), this); - reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger les collections"), this); prj_activate = new QAction(QET::Icons::ProjectFile, tr("Basculer vers ce projet"), this); prj_close = new QAction(QET::Icons::DocumentClose, tr("Fermer ce projet"), this); prj_edit_prop = new QAction(QET::Icons::DialogInformation, tr("Propriétés du projet"), this); @@ -72,7 +71,6 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) { connect(open_directory, SIGNAL(triggered()), this, SLOT(openDirectoryForSelectedItem())); connect(copy_path, SIGNAL(triggered()), this, SLOT(copyPathForSelectedItem())); - connect(reload, SIGNAL(triggered()), this, SLOT(reloadAndFilter())); connect(prj_activate, SIGNAL(triggered()), this, SLOT(activateProject())); connect(prj_close, SIGNAL(triggered()), this, SLOT(closeProject())); connect(prj_edit_prop, SIGNAL(triggered()), this, SLOT(editProjectProperties())); @@ -148,13 +146,11 @@ void ElementsPanelWidget::copyPathForSelectedItem() { */ void ElementsPanelWidget::reloadAndFilter() { // recharge tous les elements - reload -> setEnabled(false); elements_panel -> reload(true); // reapplique le filtre if (!filter_textfield -> text().isEmpty()) { elements_panel -> filter(filter_textfield -> text()); } - reload -> setEnabled(true); } /** diff --git a/sources/elementspanelwidget.h b/sources/elementspanelwidget.h index 3a1fdbc99..0c9fd43ed 100644 --- a/sources/elementspanelwidget.h +++ b/sources/elementspanelwidget.h @@ -40,7 +40,6 @@ class ElementsPanelWidget : public QWidget { private: ElementsPanel *elements_panel; QAction *open_directory, *copy_path; - QAction *reload; 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; diff --git a/sources/genericpanel.cpp b/sources/genericpanel.cpp index 71dea2f8e..aa25d943f 100644 --- a/sources/genericpanel.cpp +++ b/sources/genericpanel.cpp @@ -253,14 +253,6 @@ QTreeWidgetItem *GenericPanel::addDiagram(Diagram *diagram, QTreeWidgetItem *par /** -*/ -QTreeWidgetItem *GenericPanel::itemForDiagram(Diagram *diagram) { - if (!diagram) return(0); - return(diagrams_.value(diagram, 0)); -} - -/** - */ QTreeWidgetItem *GenericPanel::getItemForDiagram(Diagram *diagram, bool *created) { if (!diagram) return(0); @@ -454,13 +446,6 @@ QTreeWidgetItem *GenericPanel::addTemplate(const TitleBlockTemplateLocation &tb_ /** -*/ -QTreeWidgetItem *GenericPanel::itemForTemplate(const TitleBlockTemplateLocation &tb_template) { - return(tb_templates_.value(tb_template, 0)); -} - -/** - */ QTreeWidgetItem *GenericPanel::getItemForTemplate(const TitleBlockTemplateLocation &tb_template, bool *created) { if (!tb_template.isValid()) return(0); @@ -704,17 +689,6 @@ void GenericPanel::deleteItem(QTreeWidgetItem *item, bool deleted_on_cascade) { delete item; } -/** - Mark an item as being a container (collection, category, ...) -*/ -void GenericPanel::markItemAsContainer(QTreeWidgetItem *qtwi) { - if (!qtwi) return; - QLinearGradient t(0, 0, 200, 0); - t.setColorAt(0, QColor("#e8e8e8")); - t.setColorAt(1, QColor("#ffffff")); - qtwi -> setBackground(0, QBrush(t)); -} - /** Mark the provided QTreeWidgetItem as unused in its parent project. @param qtwi A QTreeWidgetItem @@ -809,16 +783,6 @@ void GenericPanel::unregisterItem(QTreeWidgetItem *item) { } } -/** - -*/ -void GenericPanel::clearPanel() { - clear(); - projects_.clear(); - diagrams_.clear(); - tb_templates_.clear(); -} - /** Handle various events; reimplemented here to emit the signal firstActivated(). diff --git a/sources/genericpanel.h b/sources/genericpanel.h index 110780c2d..d3a6dcb6c 100644 --- a/sources/genericpanel.h +++ b/sources/genericpanel.h @@ -82,7 +82,6 @@ class GenericPanel : public QTreeWidget { // diagram-related methods public: virtual QTreeWidgetItem *addDiagram(Diagram *, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); - virtual QTreeWidgetItem *itemForDiagram(Diagram *); protected: virtual QTreeWidgetItem *getItemForDiagram(Diagram *, bool * = 0); virtual QTreeWidgetItem *updateDiagramItem(QTreeWidgetItem *, Diagram *, PanelOptions = AddAllChild, bool = false); @@ -100,7 +99,6 @@ class GenericPanel : public QTreeWidget { // title block templates methods public: virtual QTreeWidgetItem *addTemplate(const TitleBlockTemplateLocation &, QTreeWidgetItem * = 0, PanelOptions = AddAllChild); - virtual QTreeWidgetItem *itemForTemplate(const TitleBlockTemplateLocation &); protected: virtual QTreeWidgetItem *getItemForTemplate(const TitleBlockTemplateLocation &, bool * = 0); virtual QTreeWidgetItem *updateTemplateItem(QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions = AddAllChild, bool = false); @@ -127,14 +125,12 @@ class GenericPanel : public QTreeWidget { virtual QIcon defaultIcon(QET::ItemType); virtual QTreeWidgetItem *makeItem(QET::ItemType, QTreeWidgetItem * = 0, const QString & = QString(), const QIcon & = QIcon()); virtual void deleteItem(QTreeWidgetItem *, bool = false); - virtual void markItemAsContainer(QTreeWidgetItem *); virtual void markItemAsUnused(QTreeWidgetItem *); virtual void reparent(QTreeWidgetItem *, QTreeWidgetItem *); QList childItems(QTreeWidgetItem *, QET::ItemType, bool = false) const; template void removeObsoleteItems(const QList &, QTreeWidgetItem *, QET::ItemType, bool); template T valueForItem(QTreeWidgetItem *) const; void unregisterItem(QTreeWidgetItem *); - void clearPanel(); bool event(QEvent *);