Add "[Binding]" config subgroup
Binding specific configuration goes here. It is stored as a String->Value hash.
This commit is contained in:
		
							parent
							
								
									d151986c72
								
							
						
					
					
						commit
						57c806e9b5
					
				
					 2 changed files with 22 additions and 0 deletions
				
			
		| 
						 | 
					@ -58,6 +58,22 @@ void Config::read()
 | 
				
			||||||
	QStringList _rtps = confFile.value("RTPs").toStringList();
 | 
						QStringList _rtps = confFile.value("RTPs").toStringList();
 | 
				
			||||||
	Q_FOREACH(const QString &s, _rtps)
 | 
						Q_FOREACH(const QString &s, _rtps)
 | 
				
			||||||
		rtps << s.toUtf8();
 | 
							rtps << s.toUtf8();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						confFile.beginGroup("Binding");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						QStringList bindingKeys = confFile.childKeys();
 | 
				
			||||||
 | 
						Q_FOREACH (const QString &key, bindingKeys)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							QVariant value = confFile.value(key);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							/* Convert QString to QByteArray */
 | 
				
			||||||
 | 
							if (value.type() == QVariant::String)
 | 
				
			||||||
 | 
								value = value.toString().toUtf8();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							bindingConf.insert(key.toAscii(), value);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						confFile.endGroup();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void Config::readGameINI()
 | 
					void Config::readGameINI()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,6 +24,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QByteArray>
 | 
					#include <QByteArray>
 | 
				
			||||||
#include <QVector>
 | 
					#include <QVector>
 | 
				
			||||||
 | 
					#include <QHash>
 | 
				
			||||||
 | 
					#include <QVariant>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct Config
 | 
					struct Config
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -43,6 +45,10 @@ struct Config
 | 
				
			||||||
	QByteArray customScript;
 | 
						QByteArray customScript;
 | 
				
			||||||
	QVector<QByteArray> rtps;
 | 
						QVector<QByteArray> rtps;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Any values in the [Binding]
 | 
				
			||||||
 | 
						 * group are collected here */
 | 
				
			||||||
 | 
						QHash<QByteArray, QVariant> bindingConf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Game INI contents */
 | 
						/* Game INI contents */
 | 
				
			||||||
	struct {
 | 
						struct {
 | 
				
			||||||
		QByteArray scripts;
 | 
							QByteArray scripts;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue