[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kate
From: Christoph Cullmann <cullmann () kde ! org>
Date: 2010-08-29 15:30:29
Message-ID: 20100829153029.B5E18AC857 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1169539 by cullmann:
remove edit source, good idea, never got really used, if we want that, must go to \
buffer perhaps
M +13 -23 document/katedocument.cpp
M +10 -36 document/katedocument.h
M +1 -1 view/kateview.cpp
--- trunk/KDE/kdelibs/kate/document/katedocument.cpp #1169538:1169539
@@ -804,15 +804,10 @@
//
// Starts an edit session with (or without) undo, update of view disabled during \
session //
-void KateDocument::editStart (Kate::EditSource editSource)
+void KateDocument::editStart ()
{
editSessionNumber++;
- if (editSource == Kate::NoEditSource)
- m_editSources.push(m_editSources.isEmpty() ? Kate::UserInputEdit : \
m_editSources.top());
- else
- m_editSources.push(editSource);
-
if (editSessionNumber > 1)
return;
@@ -821,9 +816,7 @@
m_undoManager->editStart();
foreach(KateView *view,m_views)
- {
view->editStart ();
- }
m_buffer->editStart ();
}
@@ -845,8 +838,6 @@
editSessionNumber--;
- m_editSources.pop();
-
if (editSessionNumber > 0)
return;
@@ -860,8 +851,7 @@
foreach(KateView *view, m_views)
view->editEnd (m_buffer->editTagStart(), m_buffer->editTagEnd(), \
m_buffer->editTagFrom());
- if (m_buffer->editChanged())
- {
+ if (m_buffer->editChanged()) {
setModified(true);
emit textChanged (this);
}
@@ -1015,7 +1005,7 @@
return true;
}
-bool KateDocument::editInsertText ( int line, int col, const QString &s, \
Kate::EditSource editSource ) +bool KateDocument::editInsertText ( int line, int col, \
const QString &s ) {
if (line < 0 || col < 0)
return false;
@@ -1032,7 +1022,7 @@
if (s.isEmpty())
return true;
- editStart (editSource);
+ editStart ();
QString s2 = s;
int col2 = col;
@@ -1053,7 +1043,7 @@
return true;
}
-bool KateDocument::editRemoveText ( int line, int col, int len, Kate::EditSource \
editSource ) +bool KateDocument::editRemoveText ( int line, int col, int len )
{
if (line < 0 || col < 0 || len < 0)
return false;
@@ -1074,7 +1064,7 @@
if (col >= l->text().size())
return false;
- editStart (editSource);
+ editStart ();
QString oldText = l->string().mid(col, len);
@@ -1254,7 +1244,7 @@
return true;
}
-bool KateDocument::editInsertLine ( int line, const QString &s, Kate::EditSource \
editSource ) +bool KateDocument::editInsertLine ( int line, const QString &s )
{
if (line < 0)
return false;
@@ -1265,7 +1255,7 @@
if ( line > lines() )
return false;
- editStart (editSource);
+ editStart ();
m_undoManager->slotLineInserted(line, s);
@@ -1321,12 +1311,12 @@
return true;
}
-bool KateDocument::editRemoveLine ( int line, Kate::EditSource editSource )
+bool KateDocument::editRemoveLine ( int line )
{
- return editRemoveLines(line, line, editSource);
+ return editRemoveLines(line, line);
}
-bool KateDocument::editRemoveLines ( int from, int to, Kate::EditSource editSource )
+bool KateDocument::editRemoveLines ( int from, int to )
{
if (to < from || from < 0 || to > lastLine())
return false;
@@ -1337,7 +1327,7 @@
if (lines() == 1)
return editRemoveText(0, 0, kateTextLine(0)->length());
- editStart(editSource);
+ editStart();
QStringList oldText;
for (int line = to; line >= from; line--) {
@@ -2817,7 +2807,7 @@
m_undoManager->undoSafePoint();
- editStart (Kate::CutCopyPasteEdit);
+ editStart ();
KTextEditor::Cursor pos = view->cursorPosition();
if (!view->config()->persistentSelection() && view->selection()) {
--- trunk/KDE/kdelibs/kate/document/katedocument.h #1169538:1169539
@@ -68,31 +68,6 @@
class KateAutoIndent;
-namespace Kate
-{
- enum EditSource {
- /// Editing from opening a file
- OpenFileEdit,
- /// Editing from closing a file
- CloseFileEdit,
- /// Editing performed by the user
- UserInputEdit,
- /// Editing performed by the user within an input method context
- InputMethodContextEdit,
- /// Editing from cutting, copying and pasting
- CutCopyPasteEdit,
- /// Edits from code completion
- CodeCompletionEdit,
- /// Editing from a client application, eg. kdevelop.
- ThirdPartyEdit,
- /// Other internal editing done by Kate
- InternalEdit,
- /// An edit type which means that no edit source was otherwise specified, and \
any preexisting type should be inherited.
- NoEditSource
- };
-
-}
-
//
// Kate KTextEditor::Document class (and even KTextEditor::Editor ;)
//
@@ -213,14 +188,14 @@
/**
* Enclose editor actions with @p editStart() and @p editEnd() to group
* them.
- *
- * @param editSource the source for the grouped edit actions.
*/
- void editStart (Kate::EditSource editSource = Kate::NoEditSource);
+ void editStart ();
+
/**
* Alias for @p editStart()
*/
- void editBegin (Kate::EditSource editSource = Kate::NoEditSource) { \
editStart(editSource); } + void editBegin () { editStart(); }
+
/**
* End a editor operation.
* @see editStart()
@@ -230,7 +205,7 @@
void pushEditState();
void popEditState();
- virtual bool startEditing () { editStart (Kate::ThirdPartyEdit); return true; }
+ virtual bool startEditing () { editStart (); return true; }
virtual bool endEditing () { editEnd (); return true; }
//END editStart/editEnd
@@ -246,7 +221,7 @@
* @param s string to be inserted
* @return true on success
*/
- bool editInsertText ( int line, int col, const QString &s, Kate::EditSource \
editSource = Kate::NoEditSource ); + bool editInsertText ( int line, int col, \
const QString &s ); /**
* Remove a string in the given line/column
* @param line line number
@@ -254,7 +229,7 @@
* @param len length of text to be removed
* @return true on success
*/
- bool editRemoveText ( int line, int col, int len, Kate::EditSource editSource = \
Kate::NoEditSource ); + bool editRemoveText ( int line, int col, int len );
/**
* Mark @p line as @p autowrapped. This is necessary if static word warp is
@@ -292,15 +267,15 @@
* @param s string to insert
* @return true on success
*/
- bool editInsertLine ( int line, const QString &s, Kate::EditSource editSource = \
Kate::NoEditSource ); + bool editInsertLine ( int line, const QString &s );
/**
* Remove a line
* @param line line number
* @return true on success
*/
- bool editRemoveLine ( int line, Kate::EditSource editSource = Kate::NoEditSource \
); + bool editRemoveLine ( int line );
- bool editRemoveLines ( int from, int to, Kate::EditSource editSource = \
Kate::NoEditSource ); + bool editRemoveLines ( int from, int to );
/**
* Remove a line
@@ -330,7 +305,6 @@
private:
int editSessionNumber;
QStack<int> editStateStack;
- QStack<Kate::EditSource> m_editSources;
bool editIsRunning;
//
--- trunk/KDE/kdelibs/kate/view/kateview.cpp #1169538:1169539
@@ -1782,7 +1782,7 @@
if (!selection())
return false;
- m_doc->editStart (Kate::CutCopyPasteEdit);
+ m_doc->editStart ();
m_doc->removeText (m_selection, blockSelect);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic