diff --git a/other/.qtmindmap-0.2.ebuild.kate-swp b/other/.qtmindmap-0.2.ebuild.kate-swp deleted file mode 100644 index 5fcd7a7..0000000 Binary files a/other/.qtmindmap-0.2.ebuild.kate-swp and /dev/null differ diff --git a/other/qtmindmap-0.2.ebuild b/other/qtmindmap-0.2.ebuild index 9dcb1a2..7da179c 100644 --- a/other/qtmindmap-0.2.ebuild +++ b/other/qtmindmap-0.2.ebuild @@ -22,8 +22,8 @@ RDEPEND="${DEPEND}" src_configure() { eqmake4 "${S}"/qtmindmap-qtmindmap/qtmindmap.pro -# lrelease /qtmindmap-qtmindmap/lang/qtmindmap_hu.ts -# lrelease /qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.ts + lrelease "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_hu.ts + lrelease "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.ts } src_install() { @@ -32,7 +32,7 @@ src_install() { insinto /usr/bin doins qtmindmap -# insinto /usr/share/qtmindmap/i18n -# doins /qtmindmap-qtmindmap/lang/qtmindmap_hu.ts -# doins /qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.ts + insinto /usr/share/qtmindmap/i18n + doins "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_hu.qm + doins "${S}"/qtmindmap-qtmindmap/lang/qtmindmap_nb_NO.qm } \ No newline at end of file diff --git a/src/graphwidget.cpp b/src/graphwidget.cpp index 07f21ba..517d63e 100644 --- a/src/graphwidget.cpp +++ b/src/graphwidget.cpp @@ -436,15 +436,15 @@ void GraphWidget::nodeColor() QColorDialog dialog(this); dialog.setWindowTitle(tr("Select node color")); dialog.setCurrentColor(m_activeNode->color()); - if (dialog.exec()) + if (!dialog.exec()) + return; + + QColor color = dialog.selectedColor(); + foreach(Node *node, nodeList) { - QColor color = dialog.selectedColor(); - foreach(Node *node, nodeList) - { - node->setColor(color); - foreach (Edge * edge, node->edgesToThis(false)) - edge->setColor(color); - } + node->setColor(color); + foreach (Edge * edge, node->edgesToThis(false)) + edge->setColor(color); } } @@ -472,12 +472,12 @@ void GraphWidget::nodeTextColor() QColorDialog dialog(this); dialog.setWindowTitle(tr("Select text color")); dialog.setCurrentColor(m_activeNode->textColor()); - if (dialog.exec()) - { - QColor color = dialog.selectedColor(); - foreach(Node *node, nodeList) - node->setTextColor(color); - } + if (!dialog.exec()) + return; + + QColor color = dialog.selectedColor(); + foreach(Node *node, nodeList) + node->setTextColor(color); } void GraphWidget::addEdge() diff --git a/src/main.cpp b/src/main.cpp index c8752d9..53ba785 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,8 @@ int main(int argc, char *argv[]) // translation QString locale = QLocale::system().name(); QTranslator translator; - if (locale != "C" && !translator.load(QString("qtmindmap_") + locale)) + if (locale != "C" && !translator.load( + QString("/usr/share/qtmindmap/i18n/qtmindmap_") + locale)) { std::cerr << "No translation file for locale: " << locale.toStdString() diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ca33a32..bd772e6 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -100,14 +100,10 @@ void MainWindow::openFile(const QString &fileName) dialog.setAcceptMode(QFileDialog::AcceptOpen); dialog.setDefaultSuffix("qmm"); - if (dialog.exec()) - { - m_fileName = dialog.selectedFiles().first(); - } - else - { + if (!dialog.exec()) return; - } + + m_fileName = dialog.selectedFiles().first(); } else { @@ -162,17 +158,13 @@ bool MainWindow::saveFileAs() dialog.setAcceptMode(QFileDialog::AcceptSave); dialog.setDefaultSuffix("qmm"); - if (dialog.exec()) - { - m_fileName = dialog.selectedFiles().first(); - setTitle(m_fileName); - saveFile(); - return true; - } - else - { - return false; // cancelled - } + if (!dialog.exec()) + return false; + + m_fileName = dialog.selectedFiles().first(); + setTitle(m_fileName); + saveFile(); + return true; } bool MainWindow::closeFile()