diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-03-17 20:06:32 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-03-17 20:06:32 (GMT) |
commit | a6383d9ed3381975337e1d100427f7c022f0a247 (patch) | |
tree | 00707d37411897cf3c63f4239252dc4355d04ba0 /addon | |
parent | 4db68bb500d6f4fe1d810a411d4c8713f99e4231 (diff) | |
download | Doxygen-a6383d9ed3381975337e1d100427f7c022f0a247.zip Doxygen-a6383d9ed3381975337e1d100427f7c022f0a247.tar.gz Doxygen-a6383d9ed3381975337e1d100427f7c022f0a247.tar.bz2 |
Simplified the code a bit
Diffstat (limited to 'addon')
-rwxr-xr-x | addon/doxywizard/doxywizard.cpp | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp index c574c05..5f8b1bc 100755 --- a/addon/doxywizard/doxywizard.cpp +++ b/addon/doxywizard/doxywizard.cpp @@ -343,10 +343,7 @@ void MainWindow::clearRecent() m_recentFiles.clear(); for (int i=0;i<MAX_RECENT_FILES;i++) { - QString res; - QTextStream out(&res); - out << "recent/config" << i++; - m_settings.setValue(res,QString::fromLatin1("")); + m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i++),QString::fromLatin1("")); } m_settings.sync(); } @@ -392,10 +389,7 @@ void MainWindow::loadSettings() /* due to prepend use list in reversed order */ for (int i=MAX_RECENT_FILES;i>=0;i--) { - QString res; - QTextStream out(&res); - out << "recent/config" << i; - QString entry = m_settings.value(res).toString(); + QString entry = m_settings.value(QString::fromLatin1("recent/config%1").arg(i)).toString(); if (!entry.isEmpty() && QFileInfo(entry).exists()) { addRecentFileList(entry); @@ -453,18 +447,12 @@ void MainWindow::updateRecentFile(void) int i=0; foreach( QString str, m_recentFiles ) { - QString res; - QTextStream out(&res); - out << "recent/config" << i++; m_recentMenu->addAction(str); - m_settings.setValue(res,str); + m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i++),str); } for (;i<MAX_RECENT_FILES;i++) { - QString res; - QTextStream out(&res); - out << "recent/config" << i; - m_settings.setValue(res,QString::fromLatin1("")); + m_settings.setValue(QString::fromLatin1("recent/config%1").arg(i),QString::fromLatin1("")); } } @@ -701,22 +689,16 @@ int main(int argc,char **argv) { if (!qstrcmp(argv[1],"--help")) { - QString res; - QTextStream out(&res); - out << "Usage: " << argv[0] << " [config file]"; QMessageBox msgBox; - msgBox.setText(res); + msgBox.setText(QString::fromLatin1("Usage: %1 [config file]").arg(QString::fromLatin1(argv[0]))); msgBox.exec(); exit(0); } } if (argc > 2) { - QString res; - QTextStream out(&res); - out << "Too many arguments specified\n\nUsage: " << argv[0] << " [config file]"; QMessageBox msgBox; - msgBox.setText(res); + msgBox.setText(QString::fromLatin1("Too many arguments specified\n\nUsage: %1 [config file]").arg(QString::fromLatin1(argv[0]))); msgBox.exec(); exit(1); } |