Commit 3a5062f9 authored by Michael Reeves's avatar Michael Reeves

Make --auto optional

Accdiently release kdiff3 with a hack hard disabling --auto. Now you
can do that with a cmake option if you want. The use of --auto is enabled by
default like with the 0.9x.  This patch adds a short string used only if
ENABLE_AUTO = off.
parent 1c86432a
......@@ -51,6 +51,8 @@ find_package(
)
set_package_properties(KF5DocTools PROPERTIES PURPOSE "Allows generating and installing docs.")
option(ENABLE_AUTO "Enable kdiff3's '--auto' flag" ON)
option(ENABLE_CLANG_TIDY "Run clang-tidy if available and cmake version >=3.6" OFF)
set(KDiff3_LIBRARIES ${Qt5PrintSupport_LIBRARIES} KF5::I18n KF5::CoreAddons KF5::IconThemes )
......@@ -91,6 +93,12 @@ set(
cxx_static_assert
)
if(ENABLE_AUTO)
add_definitions(
-DENABLE_AUTO
)
endif()
add_definitions(
-DQT_DEPRECATED_WARNINGS #Get warnings from QT about deprecated functions.
-DQT_NO_URL_CAST_FROM_STRING # casting from string to url does not always behave as you might think
......
......@@ -222,7 +222,12 @@ KDiff3App::KDiff3App(QWidget* pParent, const QString& name, KDiff3Part* pKDiff3P
m_sd2.setOptions(m_pOptions);
m_sd3.setOptions(m_pOptions);
m_bAutoFlag = false; //disable --auto option git hard codes this unwanted flag.
#ifdef ENABLE_AUTO
m_bAutoFlag = hasArgs && KDiff3Shell::getParser()->isSet("auto");
#else
m_bAutoFlag = false;
#endif
m_bAutoMode = m_bAutoFlag || m_pOptions->m_bAutoSaveAndQuitOnMergeWithoutConflicts;
if(hasArgs) {
m_outputFilename = KDiff3Shell::getParser()->value("output");
......
......@@ -395,8 +395,8 @@ class KDiff3App : public QSplitter
KToolBar* toolBar(QLatin1String);
KDiff3Part* m_pKDiff3Part;
KParts::MainWindow* m_pKDiff3Shell;
bool m_bAutoFlag;
bool m_bAutoMode;
bool m_bAutoFlag = false;
bool m_bAutoMode = false;
void recalcWordWrap(int visibleTextWidthForPrinting = -1);
bool m_bRecalcWordWrapPosted;
void setHScrollBarRange();
......
......@@ -113,7 +113,11 @@ int main(int argc, char* argv[])
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("b") << QLatin1String("base"), i18n("Explicit base file. For compatibility with certain tools."), QLatin1String("file")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("o") << QLatin1String("output"), i18n("Output file. Implies -m. E.g.: -o newfile.txt"), QLatin1String("file")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("out"), i18n("Output file, again. (For compatibility with certain tools.)"), QLatin1String("file")));
#ifdef ENABLE_AUTO
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("auto"), i18n("No GUI if all conflicts are auto-solvable. (Needs -o file)")));
#else
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("auto"), i18n("Ignored.")));
#endif
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("qall"), i18n("Do not solve conflicts automatically.")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L1"), i18n("Visible name replacement for input file 1 (base)."), QLatin1String("alias1")));
cmdLineParser->addOption(QCommandLineOption(QStringList() << QLatin1String("L2"), i18n("Visible name replacement for input file 2."), QLatin1String("alias2")));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment