Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Maybe fix linux absolute paths + Minor stuff.

  • Loading branch information...
commit 14dad6880f5c17e8c8e769f02de38a19ba066348 1 parent 6298f6c
@hacst hacst authored
Showing with 23 additions and 25 deletions.
  1. +22 −24 src/mumble/VoiceRecorder.cpp
  2. +1 −1  src/mumble/VoiceRecorderDialog.cpp
View
46 src/mumble/VoiceRecorder.cpp
@@ -99,7 +99,7 @@ QString VoiceRecorder::sanitizeFilenameOrPathComponent(const QString &str) const
QString VoiceRecorder::expandTemplateVariables(const QString &path, boost::shared_ptr<RecordBuffer> rb) const {
// Split path into components
QString res;
- QStringList comp = path.split(QLatin1Char('/'), QString::SkipEmptyParts);
+ QStringList comp = path.split(QLatin1Char('/'));
Q_ASSERT(!comp.isEmpty());
QString username(QLatin1String("Mixdown"));
@@ -135,42 +135,40 @@ QString VoiceRecorder::expandTemplateVariables(const QString &path, boost::share
*/
bool replacements = false;
- {
- QString tmp;
-
- tmp.reserve(str.length() * 2);
- for (int i = 0; i < str.size(); ++i) {
- bool replaced = false;
- if (str[i] == QLatin1Char('%')) {
- QHashIterator<const QString, QString> it(vars);
- while (it.hasNext()) {
- it.next();
- if (str.midRef(i + 1, it.key().length()) == it.key()) {
- i += it.key().length();
- tmp += it.value();
- replaced = true;
- replacements = true;
- break;
- }
+ QString tmp;
+
+ tmp.reserve(str.length() * 2);
+ for (int i = 0; i < str.size(); ++i) {
+ bool replaced = false;
+ if (str[i] == QLatin1Char('%')) {
+ QHashIterator<const QString, QString> it(vars);
+ while (it.hasNext()) {
+ it.next();
+ if (str.midRef(i + 1, it.key().length()) == it.key()) {
+ i += it.key().length();
+ tmp += it.value();
+ replaced = true;
+ replacements = true;
+ break;
}
}
-
- if (!replaced)
- tmp += str[i];
}
- str = tmp;
+ if (!replaced)
+ tmp += str[i];
}
+ str = tmp;
+
if (replacements)
str = sanitizeFilenameOrPathComponent(str);
- if (first) {
+ if (first && !str.isEmpty()) {
res.append(str);
- first = false;
} else {
res.append(QLatin1Char('/') + str);
}
+ first = false;
}
return res;
}
View
2  src/mumble/VoiceRecorderDialog.cpp
@@ -136,7 +136,7 @@ void VoiceRecorderDialog::on_qpbStart_clicked() {
if (basename.isEmpty()) {
- basename = QLatin1String("%name");
+ basename = QLatin1String("%user");
}
qleFilename->setText(basename);
Please sign in to comment.
Something went wrong with that request. Please try again.