aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Haumann <dhaumann@kde.org>2012-02-26 11:47:49 (GMT)
committerDominik Haumann <dhaumann@kde.org>2012-02-26 11:47:49 (GMT)
commit37c43c80225c09cb277c766f18f0834e22212796 (patch)
tree031d21dd11ef1d2e0b8f20206819d336bfb8eda9
parentcb240494cb16a63a0d45450c157ce12124628b3e (diff)
hidden option: disable line modification markersv4.8.1
In KDE >= 4.8.1, it is now possible to disable the line modification system in Kate with kwriteconfig --file katerc --group "Kate View Defaults" --key "Line Modification" --type bool false This only works if all Kate instances are closed. To enable it again, close Kate and run kwriteconfig --file katerc --group "Kate View Defaults" --key "Line Modification" --type bool true If you want to do the same for KWrite or Kile, use kwriterc or kilerc instead of katerc. Same for KDevelop or other applications using kate part. In master (KDE 4.9), there is a graphical option in "Appearance > Borders" CCMAIL: kwrite-devel@kde.org CCMAIL: kile-devel@lists.sourceforge.net CCMAIL: lueber@gmail.com
-rw-r--r--part/utils/kateconfig.cpp24
-rw-r--r--part/utils/kateconfig.h5
-rw-r--r--part/view/kateviewhelpers.cpp17
3 files changed, 40 insertions, 6 deletions
diff --git a/part/utils/kateconfig.cpp b/part/utils/kateconfig.cpp
index 4bb82b3..21bf263 100644
--- a/part/utils/kateconfig.cpp
+++ b/part/utils/kateconfig.cpp
@@ -1066,6 +1066,7 @@ KateViewConfig::KateViewConfig ()
m_scrollBarMarksSet (true),
m_iconBarSet (true),
m_foldingBarSet (true),
+ m_lineModificationSet (true),
m_bookmarkSortSet (true),
m_autoCenterLinesSet (true),
m_searchFlagsSet (true),
@@ -1099,6 +1100,7 @@ KateViewConfig::KateViewConfig (KateView *view)
m_scrollBarMarksSet (false),
m_iconBarSet (false),
m_foldingBarSet (false),
+ m_lineModificationSet (false),
m_bookmarkSortSet (false),
m_autoCenterLinesSet (false),
m_searchFlagsSet (false),
@@ -1144,6 +1146,8 @@ void KateViewConfig::readConfig ( const KConfigGroup &config)
setFoldingBar (config.readEntry( "Folding Bar", true));
+ setLineModification (config.readEntry( "Line Modification", true));
+
setBookmarkSort (config.readEntry( "Bookmark Menu Sorting", 0 ));
setAutoCenterLines (config.readEntry( "Auto Center Lines", 0 ));
@@ -1195,6 +1199,8 @@ void KateViewConfig::writeConfig (KConfigGroup &config)
config.writeEntry( "Folding Bar", foldingBar() );
+ config.writeEntry( "Line Modification", lineModification() );
+
config.writeEntry( "Bookmark Menu Sorting", bookmarkSort() );
config.writeEntry( "Auto Center Lines", autoCenterLines() );
@@ -1373,6 +1379,24 @@ void KateViewConfig::setFoldingBar (bool on)
configEnd ();
}
+bool KateViewConfig::lineModification () const
+{
+ if (m_lineModificationSet || isGlobal())
+ return m_lineModification;
+
+ return s_global->lineModification();
+}
+
+void KateViewConfig::setLineModification (bool on)
+{
+ configStart ();
+
+ m_lineModificationSet = true;
+ m_lineModification = on;
+
+ configEnd ();
+}
+
int KateViewConfig::bookmarkSort () const
{
if (m_bookmarkSortSet || isGlobal())
diff --git a/part/utils/kateconfig.h b/part/utils/kateconfig.h
index 0eef436..446347c 100644
--- a/part/utils/kateconfig.h
+++ b/part/utils/kateconfig.h
@@ -443,6 +443,9 @@ class KATEPART_TESTS_EXPORT KateViewConfig : public KateConfig
bool foldingBar () const;
void setFoldingBar (bool on);
+ bool lineModification() const;
+ void setLineModification(bool on);
+
int bookmarkSort () const;
void setBookmarkSort (int mode);
@@ -523,6 +526,7 @@ class KATEPART_TESTS_EXPORT KateViewConfig : public KateConfig
bool m_scrollBarMarks;
bool m_iconBar;
bool m_foldingBar;
+ bool m_lineModification;
int m_bookmarkSort;
int m_autoCenterLines;
long m_searchFlags;
@@ -547,6 +551,7 @@ class KATEPART_TESTS_EXPORT KateViewConfig : public KateConfig
bool m_scrollBarMarksSet : 1;
bool m_iconBarSet : 1;
bool m_foldingBarSet : 1;
+ bool m_lineModificationSet : 1;
bool m_bookmarkSortSet : 1;
bool m_autoCenterLinesSet : 1;
bool m_searchFlagsSet : 1;
diff --git a/part/view/kateviewhelpers.cpp b/part/view/kateviewhelpers.cpp
index 6cd1f92..3ea0b2c 100644
--- a/part/view/kateviewhelpers.cpp
+++ b/part/view/kateviewhelpers.cpp
@@ -876,10 +876,13 @@ QSize KateIconBorder::sizeHint() const
if (m_foldingMarkersOn)
w += iconPaneWidth;
- /**
- * space for the line change system and border!
- */
- w += 5;
+ // space for the line modification system border
+ if (m_view->config()->lineModification()) {
+ w += 3;
+ }
+
+ // two pixel space
+ w += 2;
return QSize( w, 0 );
}
@@ -1251,10 +1254,12 @@ void KateIconBorder::paintBorder (int /*x*/, int y, int /*width*/, int height)
}
// modified line system
- if (realLine > -1 && !m_doc->url().isEmpty()) {
+ if (m_view->config()->lineModification() &&
+ realLine > -1 && !m_doc->url().isEmpty())
+ {
// one pixel space
++lnX;
-
+
Kate::TextLine tl = m_doc->plainKateTextLine(realLine);
if (tl->markedAsModified()) {
p.setPen(Qt::red);