Commit d4501d3f authored by Ian Reinhart Geiser's avatar Ian Reinhart Geiser

Fixed astyle adaptor is using "PadOperators" option for padding both

operators and parenthesis.
Bug# 121106

Fixed keep one-line blocks option does nothing.
Bug# 105396

Fixed custom style preview.  This was closed, but it was not working 
right, the preview would always be wrong.
Bug# 70818

BUG: 121106
BUG: 105396
BUG: 78020
parent 8e3e4e8e
......@@ -90,11 +90,11 @@ KDevFormatter::KDevFormatter()
// padding
setOperatorPaddingMode(config->readBoolEntry("PadOperators", false));
setParenthesisPaddingMode(config->readBoolEntry("PadOperators", false));
setParenthesisPaddingMode(config->readBoolEntry("PadParentheses", false));
// oneliner
setBreakOneLineBlocksMode(config->readBoolEntry("KeepBlocks", false));
setSingleStatementsMode(config->readBoolEntry("KeepStatements", false));
setBreakOneLineBlocksMode(!config->readBoolEntry("KeepBlocks", false));
setSingleStatementsMode(!config->readBoolEntry("KeepStatements", false));
}
KDevFormatter::KDevFormatter( AStyleWidget * widget )
......
......@@ -138,7 +138,24 @@ void AStyleWidget::accept()
void AStyleWidget::styleChanged( int id )
{
QString sample = "namespace foospace { class Bar { public: int foo(); private: int m_foo; }; int Bar::foo() { switch (x) { case 1: break; default: break; } if (isBar) { bar(); return m_foo+1; } else return 0; } }";
QString sample = "namespace foospace {\n"
"class Bar {\n"
"public:\n"
"int foo();\n"
"private:\n"
"int m_foo;\n"
"};\n"
"int Bar::foo() {\n"
"switch (x) {\n"
"case 1:\n"
"break;\n"
"default:\n"
"break;\n"
"} if (isBar) {\n"
"bar();\n"
"return m_foo+1;\n"
"} else return 0; \n"
"}\n }\n";
ConfigTabs->setTabEnabled(tab_2, id == 0);
ConfigTabs->setTabEnabled(tab_3, id == 0);
......
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