LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / utils / stringutils.cpp
blob6e2dfbf1743bf4c56582bbce83486903c7050457
1 /**
2 ******************************************************************************
4 * @file pathutils.cpp
5 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
6 * @brief String utilities
8 * @see The GNU Public License (GPL) Version 3
10 *****************************************************************************/
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 * for more details.
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "stringutils.h"
29 namespace Utils {
30 QString toLowerCamelCase(const QString & name)
32 QString str = name;
34 for (int i = 0; i < str.length(); ++i) {
35 if (str[i].isLower() || !str[i].isLetter()) {
36 break;
38 if (i > 0 && i < str.length() - 1) {
39 // after first, look ahead one
40 if (str[i + 1].isLower()) {
41 break;
44 str[i] = str[i].toLower();
47 return str;