# HG changeset patch # User Santeri Piippo # Date 1377351030 -10800 # Node ID 138b7c5c3c59dec3233b87202ebed7ef77281221 # Parent 5e96648f416f6db3e8f89b4ffbff49729b1690bb removed unused LabeledWidget diff -r 5e96648f416f -r 138b7c5c3c59 src/extprogs.cpp --- a/src/extprogs.cpp Sat Aug 24 16:17:48 2013 +0300 +++ b/src/extprogs.cpp Sat Aug 24 16:30:30 2013 +0300 @@ -31,7 +31,6 @@ #include "file.h" #include "widgets.h" #include "history.h" -#include "labeledwidget.h" #include "ui_ytruder.h" #include "ui_intersector.h" #include "ui_rectifier.h" @@ -393,12 +392,6 @@ insertOutput (outDATName, true, {}); } -LabeledWidget* buildColorSelector (const char* label) { - LabeledWidget* widget = new LabeledWidget (label, new QComboBox); - makeColorSelector (widget->w()); - return widget; -} - // ============================================================================= // Intersector interface // ----------------------------------------------------------------------------- diff -r 5e96648f416f -r 138b7c5c3c59 src/labeledwidget.h --- a/src/labeledwidget.h Sat Aug 24 16:17:48 2013 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * LDForge: LDraw parts authoring CAD - * Copyright (C) 2013 Santeri Piippo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef LABELEDWIDGET_H -#define LABELEDWIDGET_H - -#include "common.h" -#include -#include - -// ============================================================================= -// LabeledWidget -// -// Convenience class for a widget with a label beside it. -// ============================================================================= -template class LabeledWidget : public QWidget { - PROPERTY (QLabel*, label, setLabel) - PROPERTY (R*, widget, setWidget) - -public: - explicit LabeledWidget (const char* labelstr, QWidget* parent = null) : QWidget (parent) { - m_widget = new R (this); - commonInit (labelstr); - } - - explicit LabeledWidget (const char* labelstr, R* widget, QWidget* parent = null) : - QWidget (parent), m_widget (widget) { - - commonInit (labelstr); - } - - explicit LabeledWidget (QWidget* parent = 0, Qt::WindowFlags f = 0) { - m_widget = new R (this); - commonInit (""); - } - - R* w() const { return m_widget; } - operator R*() { return m_widget; } - -private: - Q_DISABLE_COPY (LabeledWidget) - - void commonInit (const char* labelstr) { - m_label = new QLabel (labelstr, this); - m_layout = new QHBoxLayout; - m_layout->addWidget (m_label); - m_layout->addWidget (m_widget); - setLayout (m_layout); - } - - QHBoxLayout* m_layout; -}; - -#endif // LABELEDWIDGET_H \ No newline at end of file diff -r 5e96648f416f -r 138b7c5c3c59 src/ldconfig.cpp --- a/src/ldconfig.cpp Sat Aug 24 16:17:48 2013 +0300 +++ b/src/ldconfig.cpp Sat Aug 24 16:30:30 2013 +0300 @@ -44,7 +44,6 @@ if (!f) { critical (fmt (QObject::tr ("Unable to open LDConfig.ldr for parsing! (%1)"), strerror (errno))); - delete f; return; }