Git AUTHORS.txt support
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
peri4 = Пелипенко Иван <peri4ko@yandex.ru>
|
||||
andrey = Бычков Андрей <andrey@signalmodelling.ru>
|
||||
gavrikov = Гавриков Михаил <>
|
||||
|
||||
2
pip
2
pip
Submodule pip updated: 430483cb55...eccf1d2c7b
@@ -1,6 +1,7 @@
|
||||
#include "aboutwindow.h"
|
||||
#include "ui_aboutwindow.h"
|
||||
#include "qad_types.h"
|
||||
#include "qpiconfig.h"
|
||||
#include <QApplication>
|
||||
#include <QFile>
|
||||
#if QT_VERSION < 0x050000
|
||||
@@ -164,21 +165,51 @@ void AboutWindow::changeEvent(QEvent *e) {
|
||||
}
|
||||
|
||||
|
||||
void addAuthor(QString & ret, const QString & name, const QString & mail) {
|
||||
ret += QString("<p>%1 (<a href=\"mailto:%2?subject=%3\">%2</a>)</p>").arg(name, mail, QApplication::applicationName());
|
||||
}
|
||||
QString AboutWindow::authors() {
|
||||
QString ret, fc;
|
||||
if (QFile::exists(":/authors.txt")) {
|
||||
QFile f(":/authors.txt");
|
||||
if (!f.open(QIODevice::ReadOnly)) return QString();
|
||||
QString ret;
|
||||
QTextStream ts(&f);
|
||||
ts.readLine();
|
||||
f.open(QIODevice::ReadOnly);
|
||||
fc = QString::fromUtf8(f.readAll());
|
||||
} else {
|
||||
if (QFile::exists(":/AUTHORS.txt")) {
|
||||
QFile f(":/AUTHORS.txt");
|
||||
f.open(QIODevice::ReadOnly);
|
||||
fc = QString::fromUtf8(f.readAll());
|
||||
}
|
||||
}
|
||||
QTextStream ts(&fc, QIODevice::ReadOnly);
|
||||
QString l = ts.readLine();
|
||||
if (l.contains(";")) {
|
||||
QStringList sl;
|
||||
while (!ts.atEnd()) {
|
||||
QString l = ts.readLine();
|
||||
l = ts.readLine();
|
||||
if (l.isEmpty()) continue;
|
||||
QString name, mail;
|
||||
sl = l.split(";");
|
||||
if (sl.size() > 0) name = sl[0].trimmed();
|
||||
if (sl.size() > 1) mail = sl[1].trimmed();
|
||||
ret += QString("<p>%1 (<a href=\"mailto:%2?subject=%3\">%2</a>)</p>").arg(name, mail, QApplication::applicationName());
|
||||
addAuthor(ret, name, mail);
|
||||
}
|
||||
return ret;
|
||||
} else {
|
||||
QPIConfig conf(&fc);
|
||||
QPIConfig::Branch br = conf.allLeaves();
|
||||
foreach (QPIConfig::Entry * e, br) {
|
||||
l = e->toString().trimmed();
|
||||
if (!l.contains("<")) continue;
|
||||
QString name, mail;
|
||||
name = l.left(l.indexOf("<"));
|
||||
mail = l.mid(name.size() + 1);
|
||||
if (mail.endsWith(">"))
|
||||
mail.chop(1);
|
||||
name = name.trimmed();
|
||||
mail = mail.trimmed();
|
||||
addAuthor(ret, name, mail);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user