mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-13 15:29:15 -05:00
Use common format for all include guards and avoid leading underscores
Use a common format for all include guards, make sure each header file has one and make sure it's named after the file name. And as a random extra in this commit: Make sure the gen_version.h file generated by cmake ends with a line break. Closes #59.
This commit is contained in:
+6
-6
@@ -129,25 +129,25 @@ endif()
|
||||
# get git version hash
|
||||
if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
|
||||
add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#ifndef __VERSION_H__" > ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#define __VERSION_H__" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#ifndef GEN_VERSION_H" > ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#define GEN_VERSION_H" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND git log -n1 "--format=#define APP_VERSION \"%h_git\"" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#define MAJOR_VERSION 999" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#define MINOR_VERSION 0" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#define PATCH_VERSION 0" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#endif" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
COMMAND echo "#endif\n" >> ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
DEPENDS .git/HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
VERBATIM)
|
||||
else()
|
||||
file(WRITE ${CMAKE_SOURCE_DIR}/src/gen_version.h
|
||||
"#ifndef __GEN_VERSIONS_H__\n"
|
||||
"#define __GEN_VERSIONS_H__\n"
|
||||
"#ifndef GEN_VERSION_H\n"
|
||||
"#define GEN_VERSION_H\n"
|
||||
"#define APP_VERSION \"3.0.1\"\n"
|
||||
"#define MAJOR_VERSION 3\n"
|
||||
"#define MINOR_VERSION 0\n"
|
||||
"#define PATCH_VERSION 1\n"
|
||||
"#endif")
|
||||
"#endif\n")
|
||||
endif()
|
||||
|
||||
#icon and correct libs/subsystem for windows
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef __ABOUTDIALOG_H__
|
||||
#define __ABOUTDIALOG_H__
|
||||
#ifndef ABOUTDIALOG_H
|
||||
#define ABOUTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef __APPLICATION_H__
|
||||
#define __APPLICATION_H__
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __CREATEINDEXDIALOG_H__
|
||||
#define __CREATEINDEXDIALOG_H__
|
||||
#ifndef CREATEINDEXDIALOG_H
|
||||
#define CREATEINDEXDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __DBSTRUCTUREMODEL_H__
|
||||
#define __DBSTRUCTUREMODEL_H__
|
||||
#ifndef DBSTRUCTUREMODEL_H
|
||||
#define DBSTRUCTUREMODEL_H
|
||||
|
||||
#include <QAbstractItemModel>
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef __EDITDIALOG_H__
|
||||
#define __EDITDIALOG_H__
|
||||
#ifndef EDITDIALOG_H
|
||||
#define EDITDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __EDITTABLEDIALOG_H__
|
||||
#define __EDITTABLEDIALOG_H__
|
||||
#ifndef EDITTABLEDIALOG_H
|
||||
#define EDITTABLEDIALOG_H
|
||||
|
||||
#include "sqlitetypes.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __EXPORTCSVDIALOG_H__
|
||||
#define __EXPORTCSVDIALOG_H__
|
||||
#ifndef EXPORTCSVDIALOG_H
|
||||
#define EXPORTCSVDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __EXTENDEDTABLEWIDGET_H__
|
||||
#define __EXTENDEDTABLEWIDGET_H__
|
||||
#ifndef EXTENDEDTABLEWIDGET_H
|
||||
#define EXTENDEDTABLEWIDGET_H
|
||||
|
||||
#include <QTableView>
|
||||
#include "FilterTableHeader.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __FILTERTABLEHEADER_H__
|
||||
#define __FILTERTABLEHEADER_H__
|
||||
#ifndef FILTERTABLEHEADER_H
|
||||
#define FILTERTABLEHEADER_H
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QList>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __IMPORTCSVDIALOG_H__
|
||||
#define __IMPORTCSVDIALOG_H__
|
||||
#ifndef IMPORTCSVDIALOG_H
|
||||
#define IMPORTCSVDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef MAINFORM_H
|
||||
#define MAINFORM_H
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include "sqltextedit.h"
|
||||
#include "sqlitedb.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __PREFERENCESDIALOG_H__
|
||||
#define __PREFERENCESDIALOG_H__
|
||||
#ifndef PREFERENCESDIALOG_H
|
||||
#define PREFERENCESDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QVariant>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __SQLEXECUTIONAREA_H__
|
||||
#define __SQLEXECUTIONAREA_H__
|
||||
#ifndef SQLEXECUTIONAREA_H
|
||||
#define SQLEXECUTIONAREA_H
|
||||
|
||||
#include "sqltextedit.h"
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef __VACUUMDIALOG_H__
|
||||
#define __VACUUMDIALOG_H__
|
||||
#ifndef VACUUMDIALOG_H
|
||||
#define VACUUMDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
#ifndef __GEN_VERSIONS_H__
|
||||
#define __GEN_VERSIONS_H__
|
||||
#ifndef GEN_VERSION_H
|
||||
#define GEN_VERSION_H
|
||||
#define APP_VERSION "master_git"
|
||||
#define MAJOR_VERSION 999
|
||||
#define MINOR_VERSION 0
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __TESTIMPORT_H__
|
||||
#define __TESTIMPORT_H__
|
||||
#ifndef TESTIMPORT_H
|
||||
#define TESTIMPORT_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef TESTSQLOBJECTS_H
|
||||
#define TESTSQLOBJECTS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class TestTable: public QObject
|
||||
@@ -20,3 +23,5 @@ private slots:
|
||||
void createTableWithIn();
|
||||
void createTableWithNotLikeConstraint();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user