Commit eb0fde8b authored by Matthias Möller's avatar Matthias Möller

doc

removed unused commands

refs #1148

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15729 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7455073e
...@@ -123,7 +123,6 @@ void MaterialPicker::initializePlugin() { ...@@ -123,7 +123,6 @@ void MaterialPicker::initializePlugin() {
stream >> materialInfo.reflectance; stream >> materialInfo.reflectance;
stream.str(""); stream.str("");
stream.clear(); stream.clear();
savedString.push_back(QString::number(Qt::Key_unknown));
stream << savedString[8].toStdString(); stream << savedString[8].toStdString();
stream >> materialInfo.key; stream >> materialInfo.key;
...@@ -201,8 +200,9 @@ void MaterialPicker::clearList() { ...@@ -201,8 +200,9 @@ void MaterialPicker::clearList() {
materialListWidget_->clear(); materialListWidget_->clear();
materialList_.clear(); materialList_.clear();
materialStrings_.clear(); materialStrings_.clear();
OpenFlipperSettings().setValue(propName_, materialStrings_);
fillMaterialButton_->setEnabled(false); fillMaterialButton_->setEnabled(false);
//setting value empty instead of removing will cause an error at start up
OpenFlipperSettings().remove(propName_); OpenFlipperSettings().remove(propName_);
} }
...@@ -212,6 +212,7 @@ void MaterialPicker::slotRemoveCurrentItem() ...@@ -212,6 +212,7 @@ void MaterialPicker::slotRemoveCurrentItem()
{ {
if (!materialListWidget_->count()) if (!materialListWidget_->count())
return; return;
QMessageBox msgBox; QMessageBox msgBox;
QListWidgetItem* item = materialListWidget_->currentItem(); QListWidgetItem* item = materialListWidget_->currentItem();
msgBox.setText(tr("Remove ")+plainName(item->text(),materialListWidget_->currentRow())+tr("?")); msgBox.setText(tr("Remove ")+plainName(item->text(),materialListWidget_->currentRow())+tr("?"));
...@@ -357,6 +358,7 @@ QString MaterialPicker::plainName(const QString &string, int index) ...@@ -357,6 +358,7 @@ QString MaterialPicker::plainName(const QString &string, int index)
{ {
if (materialList_[index].key == Qt::Key_unknown) if (materialList_[index].key == Qt::Key_unknown)
return string; return string;
QString str(string); QString str(string);
return str.remove(0,4); return str.remove(0,4);
} }
......
...@@ -127,8 +127,12 @@ private: ...@@ -127,8 +127,12 @@ private:
bool fillMaterial_; bool fillMaterial_;
private: private:
/// returns the item name with hotkey hint
QString itemName(const QString &_name, int _key); QString itemName(const QString &_name, int _key);
/// returns the plain name of the material without hotkey hint
QString plainName(const QString &string, int index);
private slots: private slots:
void initializePlugin(); void initializePlugin();
...@@ -150,9 +154,6 @@ private slots: ...@@ -150,9 +154,6 @@ private slots:
void saveNewName ( QWidget * _editor, QAbstractItemDelegate::EndEditHint _hint ); void saveNewName ( QWidget * _editor, QAbstractItemDelegate::EndEditHint _hint );
void saveNewName (QListWidgetItem* _item); void saveNewName (QListWidgetItem* _item);
/// returns the plain name of the material without hotkey hint
QString plainName(const QString &string, int index);
/// returns a formatted string for saving /// returns a formatted string for saving
QString materialString(const MaterialInfo& _mat, const QString &_name); QString materialString(const MaterialInfo& _mat, const QString &_name);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment