Index: parts/astyle/astyle_widget.cpp
===================================================================
--- parts/astyle/astyle_widget.cpp	(revision 597647)
+++ parts/astyle/astyle_widget.cpp	(working copy)
@@ -68,15 +68,26 @@ AStyleWidget::AStyleWidget( AStylePart *
   if (s == "JAVA") id=5;
   StyleGroup->setButton(id);
 
-  // fill
-  Fill_Tabs->setChecked(config->readBoolEntry("FillTabs", true));
-  Fill_TabCount->setValue(config->readNumEntry("FillTabCount",2));
-  Fill_ForceTabs->setChecked(config->readBoolEntry("FillForceTabs",false));
-  Fill_Spaces->setChecked(config->readBoolEntry("FillSpaces",false));
-  Fill_SpaceCount->setValue(config->readNumEntry("FillSpaceCount",2));
+  if ( s == "UserDefined" ){
+
+	  int wsCount = config->readNumEntry("FillCount",2);
+	  if (config->readEntry("Fill", "Tabs") == "Tabs")
+	  {
+		  Fill_Tabs->setChecked(true);
+		  Fill_TabCount->setValue(wsCount);
+		  Fill_TabCount->setEnabled(true);
+		  Fill_ForceTabs->setChecked(config->readBoolEntry("FillForce",false));
+		  Fill_ForceTabs->setEnabled(true);
 
+	  } else
+	  {
+		  Fill_Spaces->setChecked(true);
+		  Fill_SpaceCount->setValue(wsCount);
+		  Fill_SpaceCount->setEnabled(true);
+		  Fill_ConvertTabs->setChecked(config->readBoolEntry("FillForce",false));
+		  Fill_ConvertTabs->setEnabled(true);
+	  }
 
-  Fill_ConvertTabs->setChecked(config->readBoolEntry("FillConvertTabs",false));
   Fill_EmptyLines->setChecked(config->readBoolEntry("FillEmptyLines",false));
 
   // indent
@@ -94,10 +105,17 @@ AStyleWidget::AStyleWidget( AStylePart *
   Continue_MinConditional->setValue(config->readNumEntry("MinConditional", -1));
 
   // brackets
-  Brackets_None->setChecked(config->readBoolEntry("BracketsNone", true));
-  Brackets_Break->setChecked(config->readBoolEntry("BracketsBreak", false));
-  Brackets_Attach->setChecked(config->readBoolEntry("BracketsAttach", false));
-  Brackets_Linux->setChecked(config->readBoolEntry("BracketsLinux", false));
+	 // brackets
+	s = config->readEntry("Brackets", "None");
+	if (s == "Break")
+		Brackets_Break->setChecked(true);
+	else if (s == "Attach")
+		Brackets_Attach->setChecked(true);
+	else if (s == "Linux")
+		Brackets_Linux->setChecked(true);
+	else
+		Brackets_None->setChecked(true);
+
   Brackets_CloseHeaders->setChecked(config->readBoolEntry("BracketsCloseHeaders",false));
 
   Block_Break->setChecked(config->readBoolEntry("BlockBreak",false));
@@ -114,9 +132,11 @@ AStyleWidget::AStyleWidget( AStylePart *
   // oneliner
   Keep_Statements->setChecked(config->readBoolEntry("KeepStatements", false));
   Keep_Blocks->setChecked(config->readBoolEntry("KeepBlocks", false));
-
+  }
+  else{
   styleChanged(id);
 }
+}
 
 
 AStyleWidget::~AStyleWidget()
@@ -128,12 +148,12 @@ void AStyleWidget::accept()
 {
   // save settings
   KConfig *config = kapp->config();
+
+  // delete what is there..
   config->setGroup("AStyle");
 
   // style
-  if (Style_UserDefined->isChecked())
-	config->writeEntry("Style", "UserDefined");
-  else if (Style_ANSI->isChecked())
+  if (Style_ANSI->isChecked())
 	config->writeEntry("Style", "ANSI");
   else if (Style_KR->isChecked())
     config->writeEntry("Style", "KR");
@@ -143,14 +163,22 @@ void AStyleWidget::accept()
     config->writeEntry("Style", "GNU");
   else if (Style_JAVA->isChecked())
     config->writeEntry("Style", "JAVA");
+  else if (Style_UserDefined->isChecked()){
+
+	config->writeEntry("Style", "UserDefined");
 
   // fill
-  config->writeEntry("FillTabs", Fill_Tabs->isChecked());
-  config->writeEntry("FillTabCount", Fill_SpaceCount->value());
-  config->writeEntry("FillForceTabs", Fill_ForceTabs->isChecked());
-  config->writeEntry("FillSpaces", Fill_Spaces->isChecked());
-  config->writeEntry("FillSpaceCount", Fill_SpaceCount->value());
-  config->writeEntry("FillConvertTabs", Fill_ConvertTabs->isChecked());
+	if ( Fill_Tabs->isChecked()){
+		config->writeEntry("Fill", "Tabs");
+		config->writeEntry("FillCount", Fill_TabCount->value());
+		config->writeEntry("FillForce", Fill_ForceTabs->isChecked());
+	}
+	else{
+		config->writeEntry("Fill", "Spaces");
+		config->writeEntry("FillCount", Fill_SpaceCount->value());
+		config->writeEntry("FillForce", Fill_ConvertTabs->isChecked());
+	}
+
   config->writeEntry("FillEmptyLines", Fill_EmptyLines->isChecked());
 
   // indent
@@ -168,10 +196,15 @@ void AStyleWidget::accept()
   config->writeEntry("MinConditional", Continue_MinConditional->value());
 
   // brackets
-  config->writeEntry("BracketsNone", Brackets_None->isChecked());
-  config->writeEntry("BracketsBreak", Brackets_Break->isChecked());
-  config->writeEntry("BracketsAttach", Brackets_Attach->isChecked());
-  config->writeEntry("BracketsLinux", Brackets_Linux->isChecked());
+	if ( Brackets_None->isChecked())
+		config->writeEntry("Brackets", "None");
+	else if (Brackets_Break->isChecked())
+		config->writeEntry("Brackets","Break" );
+	else if (Brackets_Attach->isChecked())
+		config->writeEntry("Brackets", "Attach" );
+	else if (Brackets_Linux->isChecked())
+		config->writeEntry("Brackets","Linux");
+
   config->writeEntry("BracketsCloseHeaders", Brackets_CloseHeaders->isChecked());
 
   // blocks
@@ -189,7 +222,7 @@ void AStyleWidget::accept()
   // oneliner
   config->writeEntry("KeepStatements", Keep_Statements->isChecked());
   config->writeEntry("KeepBlocks", Keep_Blocks->isChecked());
-
+  }
   config->sync();
 }
 
Index: parts/astyle/astyle_adaptor.cpp
===================================================================
--- parts/astyle/astyle_adaptor.cpp	(revision 597647)
+++ parts/astyle/astyle_adaptor.cpp	(working copy)
@@ -54,16 +54,17 @@ KDevFormatter::KDevFormatter()
 	}
 
   // fill
-  if (config->readEntry("Fill", "Tabs") != "Tabs")
+	int wsCount = config->readNumEntry("FillCount",2);
+  if (config->readEntry("Fill", "Tabs") == "Tabs")
+  {
+	  setTabIndentation(wsCount, config->readBoolEntry("FillForce",false) );
+	  m_indentString = "\t";
+  } else
   {
-		int wsCount = config->readNumEntry("FillSpaces",2);
 		setSpaceIndentation(wsCount);
 		m_indentString = "";
 		m_indentString.fill(' ', wsCount);
-  } else
-  {
-	setTabIndentation();
-	m_indentString = "\t";
+	  setTabSpaceConversionMode(config->readBoolEntry("FillForce",true));
   }
 
   // indent
@@ -80,13 +81,15 @@ KDevFormatter::KDevFormatter()
     setMinConditionalIndentLength(config->readNumEntry("MinConditional"));
 
   // brackets
-  s = config->readEntry("Brackets", "Break");
+  s = config->readEntry("Brackets", "None");
   if (s == "Break")
 	  setBracketFormatMode(astyle::BREAK_MODE);
-  if (s == "Attach")
+  else if (s == "Attach")
 	  setBracketFormatMode(astyle::ATTACH_MODE);
-  if (s == "Linux")
+  else if (s == "Linux")
 	  setBracketFormatMode(astyle::BDAC_MODE);
+  else
+	  setBracketFormatMode(astyle::NONE_MODE);
 
   // padding
   setOperatorPaddingMode(config->readBoolEntry("PadOperators", false));
@@ -101,6 +104,8 @@ KDevFormatter::KDevFormatter()
 
 KDevFormatter::KDevFormatter( AStyleWidget * widget )
 {
+	setCStyle();
+
 	if ( widget->Style_ANSI->isChecked() )
 	{
 		predefinedStyle( "ANSI" );
