Avoid race conditions in the build system
[quassel.git] / src / common / cliparser.cpp
index 912fb59..5168ea2 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-09 by the Quassel Project                          *
+ *   Copyright (C) 2005-2014 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -15,8 +15,9 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
+
 #include "cliparser.h"
 
 #include <QDir>
@@ -125,8 +126,8 @@ bool CliParser::init(const QStringList &args)
             // if next arg is a short/long option/switch the current arg is one too
             if (nextArg == argsRaw.constEnd() || nextArg->startsWith("-")) {
                 // switch
-                for (int i = 0; i < currentArg->mid(1).toAscii().size(); i++) {
-                    name = currentArg->mid(1).toAscii().at(i);
+                for (int i = 0; i < currentArg->mid(1).toLatin1().size(); i++) {
+                    name = currentArg->mid(1).toLatin1().at(i);
                     if (!addShortArg(CliParserArg::CliArgSwitch, name)) return false;
                 }
             }
@@ -134,7 +135,7 @@ bool CliParser::init(const QStringList &args)
             else {
                 // option
                 // short options are not freely mixable with other shortargs
-                if (currentArg->mid(1).toAscii().size() > 1) {
+                if (currentArg->mid(1).toLatin1().size() > 1) {
                     qWarning() << "Warning: Shortoptions may not be combined with other shortoptions or switches";
                     return false;
                 }
@@ -145,7 +146,7 @@ bool CliParser::init(const QStringList &args)
                     skipNext = true;
                 }
                 else value = currentArg->toLocal8Bit();
-                name = currentArg->mid(1).toAscii().at(0);
+                name = currentArg->mid(1).toLatin1().at(0);
                 // we took one argument as argument to an option so skip it next time
                 if (skipNext) currentArg++;
                 if (!addShortArg(CliParserArg::CliArgOption, name, value)) return false;