Skip to content

Commit

Permalink
+ fix a few minor issues in DlgWorkbenchesImp and QListWidgetCustom
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed May 20, 2015
1 parent d5ae198 commit dbfedbd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
16 changes: 7 additions & 9 deletions src/Gui/DlgWorkbenchesImp.cpp
Expand Up @@ -42,7 +42,7 @@ using namespace Gui::Dialog;

const QString DlgWorkbenchesImp::all_workbenches = QString::fromAscii("ALL");

/* TRANSLATOR Gui::Dialog::DlgWorkbenches */
/* TRANSLATOR Gui::Dialog::DlgWorkbenchesImp */

DlgWorkbenchesImp::DlgWorkbenchesImp(QWidget* parent)
: CustomizeActionPage(parent)
Expand All @@ -59,16 +59,14 @@ DlgWorkbenchesImp::DlgWorkbenchesImp(QWidget* parent)

for (QStringList::Iterator it = enabled_wbs_list.begin(); it != enabled_wbs_list.end(); ++it) {
if (workbenches.contains(*it)) {
QString wb = *it;
add_workbench(lw_enabled_workbenches, wb);
add_workbench(lw_enabled_workbenches, *it);
} else {
qDebug() << "Ignoring unknown " << it->toLatin1() << " workbench found in user preferences.";
qDebug() << "Ignoring unknown" << *it << "workbench found in user preferences.";
}
}
for (QStringList::Iterator it = workbenches.begin(); it != workbenches.end(); ++it) {
if (!enabled_wbs_list.contains(*it)){
QString wb = *it;
add_workbench(lw_disabled_workbenches, wb);
add_workbench(lw_disabled_workbenches, *it);
}
}
lw_enabled_workbenches->setCurrentRow(0);
Expand All @@ -90,7 +88,7 @@ void DlgWorkbenchesImp::set_lw_properties(QListWidgetCustom *lw)
lw->setDefaultDropAction(Qt::MoveAction);
}

void DlgWorkbenchesImp::add_workbench(QListWidgetCustom *lw, QString it)
void DlgWorkbenchesImp::add_workbench(QListWidgetCustom *lw, const QString& it)
{
QPixmap px = Application::Instance->workbenchIcon(it);
QString mt = Application::Instance->workbenchMenuText(it);
Expand Down Expand Up @@ -139,15 +137,15 @@ void DlgWorkbenchesImp::on_add_to_enabled_workbenches_btn_clicked()
{
QListWidgetItem* ci = lw_disabled_workbenches->currentItem();
if (ci) {
move_workbench(lw_enabled_workbenches, ci);
move_workbench(lw_enabled_workbenches, ci);
}
}

void DlgWorkbenchesImp::on_remove_from_enabled_workbenches_btn_clicked()
{
QListWidgetItem* ci = lw_enabled_workbenches->currentItem();
if (ci) {
move_workbench(lw_disabled_workbenches, ci);
move_workbench(lw_disabled_workbenches, ci);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Gui/DlgWorkbenchesImp.h
Expand Up @@ -57,7 +57,7 @@ protected Q_SLOTS:

private:
void set_lw_properties(QListWidgetCustom *lw);
void add_workbench(QListWidgetCustom *lw, QString it);
void add_workbench(QListWidgetCustom *lw, const QString& it);
void move_workbench(QListWidgetCustom *lwc_dest,
QListWidgetItem *wi);
void save_enabled_workbenches();
Expand Down
2 changes: 2 additions & 0 deletions src/Gui/QListWidgetCustom.cpp
Expand Up @@ -60,3 +60,5 @@ void QListWidgetCustom::dragMoveEvent(QDragMoveEvent *e)
e->ignore();
}
}

#include "moc_QListWidgetCustom.cpp"
6 changes: 4 additions & 2 deletions src/Gui/QListWidgetCustom.h
Expand Up @@ -28,11 +28,13 @@
#include <QDragMoveEvent>
#include <QString>

class QListWidgetCustom : public QListWidget {
class QListWidgetCustom : public QListWidget
{
Q_OBJECT

public:
QListWidgetCustom (QWidget *parent);
~QListWidgetCustom ();
virtual ~QListWidgetCustom ();

protected:
void dragMoveEvent(QDragMoveEvent *e);
Expand Down

0 comments on commit dbfedbd

Please sign in to comment.