[qet] qet/qet: [4933] Remove some unused methods |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4933
Author: blacksun
Date: 2017-03-19 16:23:07 +0100 (Sun, 19 Mar 2017)
Log Message:
-----------
Remove some unused methods
Modified Paths:
--------------
trunk/sources/elementspanel.cpp
trunk/sources/elementspanel.h
trunk/sources/elementspanelwidget.cpp
trunk/sources/elementspanelwidget.h
trunk/sources/genericpanel.cpp
trunk/sources/genericpanel.h
Modified: trunk/sources/elementspanel.cpp
===================================================================
--- trunk/sources/elementspanel.cpp 2017-03-18 11:10:54 UTC (rev 4932)
+++ trunk/sources/elementspanel.cpp 2017-03-19 15:23:07 UTC (rev 4933)
@@ -78,20 +78,6 @@
}
/**
- 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
*/
@@ -182,20 +168,6 @@
}
/**
- @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
*/
bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item, QString filter) const {
@@ -215,7 +187,6 @@
* @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");
Modified: trunk/sources/elementspanel.h
===================================================================
--- trunk/sources/elementspanel.h 2017-03-18 11:10:54 UTC (rev 4932)
+++ trunk/sources/elementspanel.h 2017-03-19 15:23:07 UTC (rev 4933)
@@ -66,10 +66,8 @@
void ensureHierarchyIsVisible(const QList<QTreeWidgetItem *> &);
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 @@
QSet<QETProject *> 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
Modified: trunk/sources/elementspanelwidget.cpp
===================================================================
--- trunk/sources/elementspanelwidget.cpp 2017-03-18 11:10:54 UTC (rev 4932)
+++ trunk/sources/elementspanelwidget.cpp 2017-03-19 15:23:07 UTC (rev 4933)
@@ -45,7 +45,6 @@
// 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 @@
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::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);
}
/**
Modified: trunk/sources/elementspanelwidget.h
===================================================================
--- trunk/sources/elementspanelwidget.h 2017-03-18 11:10:54 UTC (rev 4932)
+++ trunk/sources/elementspanelwidget.h 2017-03-19 15:23:07 UTC (rev 4933)
@@ -40,7 +40,6 @@
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;
Modified: trunk/sources/genericpanel.cpp
===================================================================
--- trunk/sources/genericpanel.cpp 2017-03-18 11:10:54 UTC (rev 4932)
+++ trunk/sources/genericpanel.cpp 2017-03-19 15:23:07 UTC (rev 4933)
@@ -254,14 +254,6 @@
/**
*/
-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);
@@ -455,13 +447,6 @@
/**
*/
-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);
@@ -705,17 +690,6 @@
}
/**
- 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
*/
@@ -810,16 +784,6 @@
}
/**
-
-*/
-void GenericPanel::clearPanel() {
- clear();
- projects_.clear();
- diagrams_.clear();
- tb_templates_.clear();
-}
-
-/**
Handle various events; reimplemented here to emit the signal
firstActivated().
*/
Modified: trunk/sources/genericpanel.h
===================================================================
--- trunk/sources/genericpanel.h 2017-03-18 11:10:54 UTC (rev 4932)
+++ trunk/sources/genericpanel.h 2017-03-19 15:23:07 UTC (rev 4933)
@@ -82,7 +82,6 @@
// 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 @@
// 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,7 +125,6 @@
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<QTreeWidgetItem *> childItems(QTreeWidgetItem *, QET::ItemType, bool = false) const;
@@ -134,7 +131,6 @@
template<typename T> void removeObsoleteItems(const QList<T> &, QTreeWidgetItem *, QET::ItemType, bool);
template<typename T> T valueForItem(QTreeWidgetItem *) const;
void unregisterItem(QTreeWidgetItem *);
- void clearPanel();
bool event(QEvent *);