Skip to content

Instantly share code, notes, and snippets.

@pvdk
pvdk / LaTeX.cls
Created June 10, 2019 11:16
Cover generating code in the TU Delft LaTeX template
%% The coverimage command is used to specify the filename of the optional cover
%% image.
\newcommand*\coverimage[1]{\def\@cover@image{#1}}
%% The covertext command can be used to specify the text printed on the back
%% cover. This text is inserted in a minipage environment and can therefore
%% include line breaks.
\newcommand\covertext[2][tudelft-white]{%
% \def\@subtitle{#1}%
\def\@covertextcolor{#1}%
\def\@cover@text{#2}}
#include <QCoreApplication>
#include <QFile>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QFile file(QLatin1String("setup.inx"));
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
@pvdk
pvdk / gist:8116436
Created December 24, 2013 18:14
WIP codec setting in wizard
QTextStream stream(&file);
QString language = field("installation.language").toString();
if (language == QLatin1String("English") ||
language == QLatin1String("German") ||
language == QLatin1String("French"))
{
stream.setCodec(QTextCodec::codecForName("windows-1252"));
}
@pvdk
pvdk / inxparser.dpr
Created November 5, 2013 10:17
Delphi .inx decompiler
{$APPTYPE CONSOLE}
uses
sysutils,windows;
type
TFileMapping = class
FFileHandle, FMappingHandle: THandle;
FMappedAddr: pointer;
public
constructor Create(Filename:String);
@pvdk
pvdk / setup.inx
Created November 4, 2013 12:10
InstallShield setup.inx file for Bloodmoon, decompiled with SID
///////////////////////////////////////////////////////////////////////////////////
///[ sexy installshield decompiler for is6/is7 ]////////
///[ (c) sn00pee 2002 ]////////
///////////////////////////////////////////////////////////////////////////////////
///[ starting decompilation ]////////
///////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////
// typedefs
@pvdk
pvdk / setup.inx
Created November 4, 2013 12:08
InstallShield setup.inx file for Bloodmoon
This file has been truncated, but you can view the full file.
/***********************************************************************
* InstallShield Decompiler v1.00 beta 16
* by NEKOSUKI
* Script Version : InstallShield 6.00
* Decompiled Time : Mon Nov 04 12:59:10 2013
* Source Filename : Z:\home\pvdk\isd_beta16\setup.inx
* Source FileTime : Mon Nov 04 12:58:58 2013
* Debug Symbol : E:\My Installations\Bloodmoon USVER\Script Files\Setup.dbg
diff --git a/apps/launcher/model/datafilesmodel.cpp b/apps/launcher/model/datafilesmodel.cpp
index e84dbe0..29980e5 100644
--- a/apps/launcher/model/datafilesmodel.cpp
+++ b/apps/launcher/model/datafilesmodel.cpp
@@ -159,20 +159,43 @@ Qt::ItemFlags DataFilesModel::flags(const QModelIndex &index) const
if (!file)
return Qt::NoItemFlags;
- if (mAvailableFiles.contains(file->fileName())) {
- if (index.column() == 0) {
class QTextStream;
class QString;
template <class Map>
class SettingsBase
{
public:
SettingsBase() {}
~SettingsBase() {}
bool GraphicsSettings::readFile(QTextStream &stream)
{
QString sectionPrefix;
QRegExp sectionRe("^\\[([^]]+)\\]");
QRegExp keyRe("^([^=]+)\\s*=\\s*(.+)$");
while (!stream.atEnd()) {
QString line = stream.readLine().simplified();
if (line.isEmpty())