Remove some unused methods

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4933 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-03-19 15:23:07 +00:00
parent a3b9c5d6c9
commit 37ec39b512
6 changed files with 0 additions and 77 deletions

View File

@@ -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");

View File

@@ -66,10 +66,8 @@ class ElementsPanel : public GenericPanel {
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 @@ class ElementsPanel : public GenericPanel {
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

View File

@@ -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);
}
/**

View File

@@ -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;

View File

@@ -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().

View File

@@ -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<QTreeWidgetItem *> childItems(QTreeWidgetItem *, QET::ItemType, bool = false) const;
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 *);