[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/konqueror/keditbookmarks
From:       Laurent Montel <montel () kde ! org>
Date:       2004-10-17 13:06:15
Message-ID: 20041017130615.F0A3916D04 () office ! kde ! org
[Download RAW message or body]

CVS commit by mlaurent: 

Fix #89099 "cut" didn't work
Pb was that toplevel is connect to "slotClipboardDataChanged()"
and this slot refresh line all the time when we cut selection


  M +31 -16    bookmarkinfo.cpp   1.10
  M +12 -5     bookmarkinfo.h   1.4


--- kdebase/konqueror/keditbookmarks/bookmarkinfo.cpp  #1.9:1.10
@@ -1,3 +1,2 @@
-// -*- mode:cperl; cperl-indent-level:4; cperl-continued-statement-offset:4; indent-tabs-mode:nil -*-
 // vim: set ts=4 sts=4 sw=4 et:
 /* This file is part of the KDE project
@@ -49,4 +48,20 @@
 // SHUFFLE all these functions around, the order is just plain stupid
 
+
+BookmarkLineEdit::BookmarkLineEdit( QWidget *parent )
+    : KLineEdit( parent )
+{
+}
+
+void BookmarkLineEdit::cut()
+{
+    QString select( selectedText() );
+    int pos( selectionStart() );
+    QString newText(  text().remove( pos, select.length() ) );
+    KLineEdit::cut();
+    emit textChanged( newText );
+    setText( newText );
+}
+
 // rename to something else
 static QString blah(QString in)
@@ -149,5 +164,5 @@ BookmarkInfoWidget::BookmarkInfoWidget(Q
     QGridLayout *grid = new QGridLayout(vbox, 3, 4, 4);
 
-    m_title_le = new KLineEdit(this);
+    m_title_le = new BookmarkLineEdit(this);
     grid->addWidget(m_title_le, 0, 1);
     grid->addWidget(
@@ -157,5 +172,5 @@ BookmarkInfoWidget::BookmarkInfoWidget(Q
                         SLOT( slotTextChangedTitle(const QString &) ));
 
-    m_url_le = new KLineEdit(this);
+    m_url_le = new BookmarkLineEdit(this);
     grid->addWidget(m_url_le, 1, 1);
     grid->addWidget(
@@ -165,5 +180,5 @@ BookmarkInfoWidget::BookmarkInfoWidget(Q
                       SLOT( slotTextChangedURL(const QString &) ));
 
-    m_comment_le = new KLineEdit(this);
+    m_comment_le = new BookmarkLineEdit(this);
     grid->addWidget(m_comment_le, 2, 1);
     grid->addWidget(

--- kdebase/konqueror/keditbookmarks/bookmarkinfo.h  #1.3:1.4
@@ -1,3 +1,2 @@
-// -*- mode:cperl; cperl-indent-level:4; cperl-continued-statement-offset:4; indent-tabs-mode:nil -*-
 // vim: set ts=4 sts=4 sw=4 et:
 /* This file is part of the KDE project
@@ -25,6 +24,14 @@
 #include <kbookmark.h>
 #include <qwidget.h>
+#include <klineedit.h>
 
-class KLineEdit;
+
+class BookmarkLineEdit : public KLineEdit {
+    Q_OBJECT
+public:
+    BookmarkLineEdit( QWidget * );
+public slots:
+    virtual void cut ();
+};
 
 class BookmarkInfoWidget : public QWidget {
@@ -43,7 +50,7 @@ signals:
     void updateListViewItem();
 private:
-    KLineEdit *m_title_le, *m_url_le, 
-              *m_comment_le, 
-              *m_visitdate_le, *m_credate_le,
+    BookmarkLineEdit *m_title_le, *m_url_le,
+        *m_comment_le;
+    KLineEdit  *m_visitdate_le, *m_credate_le,
               *m_visitcount_le;
     KBookmark m_bk;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic