mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-04 12:49:28 -04:00
Changed chatstyle structure from
[RS-Dir] / stylesheets / {public | private | history} / my_chatstyle / to [RS-Dir] / stylesheets / my_chatstyle / {public | private | history} / git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5192 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
569d463f02
commit
ff6276e920
1 changed files with 19 additions and 15 deletions
|
@ -26,15 +26,14 @@
|
||||||
Portable version: <Application dir>/stylesheets
|
Portable version: <Application dir>/stylesheets
|
||||||
|
|
||||||
stylesheets
|
stylesheets
|
||||||
+history
|
+style1
|
||||||
|-Style1
|
|-history
|
||||||
|-Style2
|
|-private
|
||||||
+private
|
|-public
|
||||||
|-Style1
|
+style2
|
||||||
|-Style2
|
|-history
|
||||||
+public
|
|-private
|
||||||
|-Style1
|
|-public
|
||||||
|-Style2
|
|
||||||
|
|
||||||
Files and dirs of the style:
|
Files and dirs of the style:
|
||||||
info.xml - description
|
info.xml - description
|
||||||
|
@ -449,7 +448,7 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||||
standardInfo.styleDescription = tr("Compact style for group chat");
|
standardInfo.styleDescription = tr("Compact style for group chat");
|
||||||
styles.append(standardInfo);
|
styles.append(standardInfo);
|
||||||
}
|
}
|
||||||
stylePath = "stylesheets/public";
|
stylePath = "public";
|
||||||
break;
|
break;
|
||||||
case TYPE_PRIVATE:
|
case TYPE_PRIVATE:
|
||||||
if (getStyleInfo(":/qss/chat/standard/private", ":/qss/chat/standard/private", standardInfo)) {
|
if (getStyleInfo(":/qss/chat/standard/private", ":/qss/chat/standard/private", standardInfo)) {
|
||||||
|
@ -460,7 +459,7 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||||
standardInfo.styleDescription = tr("Compact style for private chat");
|
standardInfo.styleDescription = tr("Compact style for private chat");
|
||||||
styles.append(standardInfo);
|
styles.append(standardInfo);
|
||||||
}
|
}
|
||||||
stylePath = "stylesheets/private";
|
stylePath = "private";
|
||||||
break;
|
break;
|
||||||
case TYPE_HISTORY:
|
case TYPE_HISTORY:
|
||||||
if (getStyleInfo(":/qss/chat/standard/history", ":/qss/chat/standard/history", standardInfo)) {
|
if (getStyleInfo(":/qss/chat/standard/history", ":/qss/chat/standard/history", standardInfo)) {
|
||||||
|
@ -471,7 +470,7 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||||
standardInfo.styleDescription = tr("Compact style for history");
|
standardInfo.styleDescription = tr("Compact style for history");
|
||||||
styles.append(standardInfo);
|
styles.append(standardInfo);
|
||||||
}
|
}
|
||||||
stylePath = "stylesheets/history";
|
stylePath = "history";
|
||||||
break;
|
break;
|
||||||
case TYPE_UNKNOWN:
|
case TYPE_UNKNOWN:
|
||||||
default:
|
default:
|
||||||
|
@ -479,7 +478,7 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||||
}
|
}
|
||||||
|
|
||||||
QDir dir(baseDir);
|
QDir dir(baseDir);
|
||||||
if (dir.cd(stylePath) == false) {
|
if (dir.cd("stylesheets") == false) {
|
||||||
// no user styles available
|
// no user styles available
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -488,9 +487,14 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle
|
||||||
QFileInfoList dirList = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
|
QFileInfoList dirList = dir.entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
|
||||||
|
|
||||||
// iterate style directories and get info
|
// iterate style directories and get info
|
||||||
for (QFileInfoList::iterator dir = dirList.begin(); dir != dirList.end(); dir++) {
|
for (QFileInfoList::iterator it = dirList.begin(); it != dirList.end(); it++) {
|
||||||
|
QDir styleDir = QDir(it->absoluteFilePath());
|
||||||
|
if (styleDir.cd(stylePath) == false) {
|
||||||
|
// no user styles available
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ChatStyleInfo info;
|
ChatStyleInfo info;
|
||||||
if (getStyleInfo(dir->absoluteFilePath(), baseDir.relativeFilePath(dir->absoluteFilePath()), info)) {
|
if (getStyleInfo(styleDir.absolutePath(), baseDir.relativeFilePath(styleDir.absolutePath()), info)) {
|
||||||
styles.append(info);
|
styles.append(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue