git clone https://github.com/juzzlin/Heimer.git
- master branch has the currently released stuff and is stable
-
Make your changes against the master branch
-
If you have fixed a bug or modified the application in some other acceptable way, I most likely want to receive the changes as a GitHub pull request
OR
-
as a Git patch (make a commit of your changes in your working branch, and then make a patch and send it via e-mail:
$ git diff master > your_change.patch
-
Please follow the existing coding style. Some examples and conventions below.
-
Generate source strings
$ lupdate src/*.cpp -ts src/translations/heimer_fr.ts
-
Edit translations in Linguist
$ linguist src/translations/heimer_fr.ts
-
Rebuild the application
This script automates the steps above (Finnish in the example):
$ ./scripts/update-translation-files fi
In the case of a new language, the new .qm
file needs to be added in data/translations/translations.qrc
. Also src/CMakeLists.txt
and heimer.pro
need to be modified so that the new .ts
file is included.
Note that the .qm
files are autogenerated from .ts
files as a part of the build process.
This works for both CMake and QMake.
Remember to TEST the translations. Heimer needs to be rebuilt after a .ts
file has been updated.
Heimer can be forced to given lang (Finnish in the example):
$ ./heimer --lang fi
-
Avoid useless comments and temp variables
-
C++11 standard
-
camelCase naming convention for members amd variables (m_-prefix for members)
-
PascalCase naming convention for class names, namespaces, and enums
-
Indentation with 4 spaces
-
No copy-paste code
-
No public/protected member variables allowed, only private variables with getters/setters
-
Prefer references and smart pointers
-
Use const always when possible
-
Use auto
-
Config for clang-format in .clang-format
#ifndef MYFOOCLASS_HPP
#define MYFOOCLASS_HPP
class MyFooClass : public MyBase
{
public:
enum class MyEnum
{
This,
That
};
MyFooClass();
virtual ~MyFooClass();
bool someMember() const;
void setSomeMember(bool someMember);
protected:
void myMethod1();
private:
void myMethod2();
bool m_someMember;
int * m_somePointer;
};
using std::shared_ptr<MyFooClass> = MyFooClassPtr;
#endif // MYFOOCLASS_HPP
#include "myfooclass.hpp"
namespace {
static const int MAX_ITEMS = 10;
}
MyFooClass::MyFooClass()
: m_someMember(false)
, m_somePointer(nullptr)
{
if (something()) {
for (int i = 0; i < MAX_ITEMS; i++) {
doSomething(i);
}
}
}
bool MyFooClass::someMember() const
{
return m_someMember;
}
void setSomeMember(bool someMember)
{
m_someMember = someMember;
}
MyFooClass::~MyFooClass()
{
}