[vlc-commits] [Git][videolan/vlc][master] qt: drop unnecessary `ClickLineEdit` widget

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Mon Mar 14 09:17:47 UTC 2022



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
8737dcd1 by Lyndon Brown at 2022-03-14T08:51:18+00:00
qt: drop unnecessary `ClickLineEdit` widget

This widget has been a mere shadow of its former self even since
3001875707021c028efb3bb953059344cef9a154 left it just wrapping a call
to `QLineEdit::setPlaceholderText()`. Considering this, and that it's only
used in one place anyway, it's really not worth keeping.

I've cleaned up related copyright notices. They had mistakenly been left in
the customwidgets files by e14f47780d83600d74cd47605765f0f225472a9f, and
having reviewed the history of `SearchLineEdit` there seems to be no
relevant link to the old `ClickLineEdit` code requiring these notices being
kept in the searchlineedit files.

- - - - -


6 changed files:

- modules/gui/qt/dialogs/open/openurl.cpp
- modules/gui/qt/dialogs/open/openurl.hpp
- modules/gui/qt/widgets/native/customwidgets.cpp
- modules/gui/qt/widgets/native/customwidgets.hpp
- modules/gui/qt/widgets/native/searchlineedit.cpp
- modules/gui/qt/widgets/native/searchlineedit.hpp


Changes:

=====================================
modules/gui/qt/dialogs/open/openurl.cpp
=====================================
@@ -25,7 +25,6 @@
 #endif
 
 #include "dialogs/open/openurl.hpp"
-#include "widgets/native/searchlineedit.hpp"
 #include "util/validators.hpp"
 
 #include <QPushButton>
@@ -35,6 +34,7 @@
 #include <QFile>
 #include <QLabel>
 #include <QVBoxLayout>
+#include <QLineEdit>
 
 #include <assert.h>
 
@@ -59,7 +59,8 @@ OpenUrlDialog::OpenUrlDialog( qt_intf_t *_p_intf,
     connect( box, &QDialogButtonBox::rejected, this, &OpenUrlDialog::reject );
 
     /* Info label and line edit */
-    edit = new ClickLineEdit( qtr( "Enter URL here..." ), this );
+    edit = new QLineEdit( this );
+    edit->setPlaceholderText( qtr( "Enter URL here..." ) );
     edit->setValidator( new UrlValidator( edit ) );
 
     QLabel *info = new QLabel( qtr( "Please enter the URL or path "


=====================================
modules/gui/qt/dialogs/open/openurl.hpp
=====================================
@@ -31,7 +31,7 @@
 #include "widgets/native/qvlcframe.hpp"
 #include "util/singleton.hpp"
 
-class ClickLineEdit;
+class QLineEdit;
 
 class OpenUrlDialog : public QVLCDialog
 {
@@ -40,7 +40,7 @@ class OpenUrlDialog : public QVLCDialog
 private:
     QString lastUrl;
     bool bClipboard, bShouldEnqueue;
-    ClickLineEdit *edit;
+    QLineEdit *edit;
 
 private slots:
     void enqueue();


=====================================
modules/gui/qt/widgets/native/customwidgets.cpp
=====================================
@@ -2,11 +2,8 @@
  * customwidgets.cpp: Custom widgets
  ****************************************************************************
  * Copyright (C) 2006-2011 the VideoLAN team
- * Copyright (C) 2004 Daniel Molkentin <molkentin at kde.org>
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
- * The "ClickLineEdit" control is based on code by  Daniel Molkentin
- * <molkentin at kde.org> for libkdepim
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by


=====================================
modules/gui/qt/widgets/native/customwidgets.hpp
=====================================
@@ -2,11 +2,8 @@
  * customwidgets.hpp: Custom widgets
  ****************************************************************************
  * Copyright (C) 2006 the VideoLAN team
- * Copyright (C) 2004 Daniel Molkentin <molkentin at kde.org>
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
- * The "ClickLineEdit" control is based on code by  Daniel Molkentin
- * <molkentin at kde.org> for libkdepim
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by


=====================================
modules/gui/qt/widgets/native/searchlineedit.cpp
=====================================
@@ -2,11 +2,8 @@
  * searchlineedit.cpp: Custom widgets
  ****************************************************************************
  * Copyright (C) 2006 the VideoLAN team
- * Copyright (C) 2004 Daniel Molkentin <molkentin at kde.org>
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
- * The "ClickLineEdit" control is based on code by  Daniel Molkentin
- * <molkentin at kde.org> for libkdepim
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by


=====================================
modules/gui/qt/widgets/native/searchlineedit.hpp
=====================================
@@ -2,11 +2,8 @@
  * searchlineedit.hpp: Custom widgets
  ****************************************************************************
  * Copyright (C) 2006 the VideoLAN team
- * Copyright (C) 2004 Daniel Molkentin <molkentin at kde.org>
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
- * The "ClickLineEdit" control is based on code by  Daniel Molkentin
- * <molkentin at kde.org> for libkdepim
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -29,16 +26,6 @@
 #include "qt.hpp"
 #include <QLineEdit>
 
-class ClickLineEdit : public QLineEdit
-{
-    Q_OBJECT
-public:
-    ClickLineEdit( const QString &msg, QWidget *parent ) : QLineEdit( parent )
-    {
-        QLineEdit::setPlaceholderText ( msg );
-    }
-};
-
 class QFramelessButton;
 class SearchLineEdit : public QLineEdit
 {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8737dcd134396f065435e02e32cfbd4098da984a

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/8737dcd134396f065435e02e32cfbd4098da984a
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list