Fix some compile waynings and code formatting

pull/2/head
reionwong 4 years ago
parent 4027ad0b81
commit c539266ab2

@ -313,7 +313,7 @@ void HistoryScrollBuffer::addCellsVector(const QVector<Character>& cells)
void HistoryScrollBuffer::addCells(const Character a[], int count)
{
HistoryLine newLine(count);
qCopy(a,a+count,newLine.begin());
std::copy(a, a + count, newLine.begin());
addCellsVector(newLine);
}
@ -729,7 +729,7 @@ void CompactHistoryScroll::addCellsVector ( const TextLine& cells )
void CompactHistoryScroll::addCells ( const Character a[], int count )
{
TextLine newLine (count);
qCopy ( a,a+count,newLine.begin() );
std::copy(a, a + count, newLine.begin());
addCellsVector(newLine);
}

@ -442,7 +442,7 @@ private:
uidLine = statusLine;
} while (!statusLine.isNull() && uidLine.isNull());
uidStrings << uidLine.split('\t', QString::SkipEmptyParts);
uidStrings << uidLine.split('\t', Qt::SkipEmptyParts);
// Must be 5 entries: 'Uid: %d %d %d %d' and
// uid string must be less than 5 chars (uint)
if (uidStrings.size() == 5)

File diff suppressed because it is too large Load Diff

@ -24,15 +24,12 @@
// Qt
#include <QColor>
#include <QPointer>
//#include <QWidget>
#include <QQuickPaintedItem>
// Konsole
#include "Filter.h"
#include "Character.h"
#include "qtermwidget.h"
//#include "konsole_export.h"
#define KONSOLEPRIVATE_EXPORT
// QMLTermWidget
#include "ksession.h"
@ -44,21 +41,17 @@ class QDropEvent;
class QLabel;
class QTimer;
class QEvent;
class QGridLayout;
class QKeyEvent;
class QScrollBar;
class QShowEvent;
class QHideEvent;
class QTimerEvent;
class QWidget;
//class KMenu;
namespace Konsole
{
enum MotionAfterPasting
{
enum MotionAfterPasting {
// No move screenwindow after pasting
NoMoveScreenWindow = 0,
// Move start of screenwindow after pasting
@ -67,7 +60,6 @@ namespace Konsole
MoveEndScreenWindow = 2
};
extern unsigned short vt100_graphics[32];
class ScreenWindow;
@ -81,7 +73,7 @@ class ScreenWindow;
*
* TODO More documentation
*/
class KONSOLEPRIVATE_EXPORT TerminalDisplay : public QQuickPaintedItem
class TerminalDisplay : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(KSession *session READ getSession WRITE setSession NOTIFY sessionChanged )
@ -107,8 +99,8 @@ class KONSOLEPRIVATE_EXPORT TerminalDisplay : public QQuickPaintedItem
public:
/** Constructs a new terminal display widget with the specified parent. */
TerminalDisplay(QQuickItem *parent=0);
virtual ~TerminalDisplay();
explicit TerminalDisplay(QQuickItem *parent = nullptr);
~TerminalDisplay() override;
/** Returns the terminal color palette used by the display. */
const ColorEntry *colorTable() const;
@ -131,8 +123,7 @@ public:
/**
* This enum describes the location where the scroll bar is positioned in the display widget.
*/
enum ScrollBarPosition
{
enum ScrollBarPosition {
/** Do not show the scroll bar. */
NoScrollBar=0,
/** Show the scroll bar on the left side of the display. */
@ -214,8 +205,7 @@ public:
* This enum describes the methods for selecting text when
* the user triple-clicks within the display.
*/
enum TripleClickMode
{
enum TripleClickMode {
/** Select the whole line underneath the cursor. */
SelectWholeLine,
/** Select from the current cursor position to the end of the line. */
@ -348,8 +338,7 @@ public:
* can be used to alert the user when a 'bell' occurs in the terminal
* session.
*/
enum BellMode
{
enum BellMode {
/** A system beep. */
SystemBeepBell=0,
/**
@ -624,30 +613,30 @@ signals:
void boldIntenseChanged();
protected:
virtual bool event( QEvent * );
bool event(QEvent *);
//virtual void paintEvent( QPaintEvent * );
//void paintEvent(QPaintEvent *);
virtual void showEvent(QShowEvent*);
virtual void hideEvent(QHideEvent*);
virtual void resizeEvent(QResizeEvent*);
void showEvent(QShowEvent *);
void hideEvent(QHideEvent *);
void resizeEvent(QResizeEvent *);
virtual void fontChange(const QFont &font);
virtual void focusInEvent(QFocusEvent* event);
virtual void focusOutEvent(QFocusEvent* event);
virtual void keyPressEvent(QKeyEvent* event);
virtual void mouseDoubleClickEvent(QMouseEvent* ev);
virtual void mousePressEvent( QMouseEvent* );
virtual void mouseReleaseEvent( QMouseEvent* );
virtual void mouseMoveEvent( QMouseEvent* );
virtual void extendSelection( const QPoint& pos );
virtual void wheelEvent( QWheelEvent* );
virtual bool focusNextPrevChild( bool next );
void focusInEvent(QFocusEvent *event);
void focusOutEvent(QFocusEvent *event);
void keyPressEvent(QKeyEvent *event);
void mouseDoubleClickEvent(QMouseEvent *ev);
void mousePressEvent(QMouseEvent*);
void mouseReleaseEvent(QMouseEvent*);
void mouseMoveEvent(QMouseEvent*);
void extendSelection(const QPoint& pos);
void wheelEvent(QWheelEvent*);
bool focusNextPrevChild(bool next);
// drag and drop
virtual void dragEnterEvent(QDragEnterEvent* event);
virtual void dropEvent(QDropEvent* event);
void dragEnterEvent(QDragEnterEvent *event);
void dropEvent(QDropEvent *event);
void doDrag();
enum DragState { diNone, diPending, diDragging };
@ -768,11 +757,9 @@ private:
// the window onto the terminal screen which this display
// is currently showing.
QPointer<ScreenWindow> _screenWindow;
bool _allowBell;
QPointer<ScreenWindow> m_screenWindow;
QGridLayout* _gridLayout;
bool m_allowBell;
bool _fixedFont; // has fixed pitch
int _fontHeight; // height
@ -845,7 +832,6 @@ private:
bool _possibleTripleClick; // is set in mouseDoubleClickEvent and deleted
// after QApplication::doubleClickInterval() delay
QLabel *_resizeWidget;
QTimer *_resizeTimer;
@ -876,8 +862,7 @@ private:
// color of the character under the cursor is used
QColor _cursorColor;
MotionAfterPasting mMotionAfterPasting;
MotionAfterPasting m_MotionAfterPasting;
struct InputMethodData
{
@ -897,7 +882,7 @@ private:
// QMLTermWidget port functions
QFont m_font;
QPalette m_palette;
QPalette::ColorRole m_color_role;
QPalette::ColorRole m_colorRole;
KSession *m_session;
bool m_full_cursor_height;
@ -906,8 +891,8 @@ private:
const QPalette palette() { return m_palette; }
void setPalette(const QPalette &p){ m_palette = p; }
QPalette::ColorRole backgroundRole() { return m_color_role; }
void setBackgroundRole(QPalette::ColorRole role) { m_color_role = role; }
QPalette::ColorRole backgroundRole() { return m_colorRole; }
void setBackgroundRole(QPalette::ColorRole role) { m_colorRole = role; }
void update(const QRegion &region);
void update();
@ -938,20 +923,6 @@ public:
bool fullCursorHeight() const;
};
class AutoScrollHandler : public QObject
{
Q_OBJECT
public:
AutoScrollHandler(QWidget* parent);
protected:
virtual void timerEvent(QTimerEvent* event);
virtual bool eventFilter(QObject* watched,QEvent* event);
private:
QWidget* widget() const { return static_cast<QWidget*>(parent()); }
int _timerId;
};
}
#endif // TERMINALDISPLAY_H

@ -1494,8 +1494,8 @@ char Vt102Emulation::eraseChar() const
{
KeyboardTranslator::Entry entry = _keyTranslator->findEntry(
Qt::Key_Backspace,
0,
0);
Qt::NoModifier,
KeyboardTranslator::NoState);
if ( entry.text().count() > 0 )
return entry.text().at(0);
else

@ -404,7 +404,7 @@ int KProcess::startDetached(const QStringList &argv)
int KProcess::pid() const
{
#ifdef Q_OS_UNIX
return (int) QProcess::pid();
return (int) QProcess::processId();
#else
return QProcess::pid() ? QProcess::pid()->dwProcessId : 0;
#endif

@ -331,7 +331,7 @@ gotpty:
!d->chownpty(true)) {
qWarning()
<< "chownpty failed for device " << ptyName << "::" << d->ttyName
<< "\nThis means the communication can be eavesdropped." << endl;
<< "\nThis means the communication can be eavesdropped." << Qt::endl;
}
#if defined (HAVE__GETPTY) || defined (HAVE_GRANTPT)

@ -238,6 +238,10 @@ void KSession::sendText(QString text)
void KSession::sendKey(int rep, int key, int mod) const
{
Q_UNUSED(rep);
Q_UNUSED(key);
Q_UNUSED(mod);
//TODO implement or remove this function.
// Qt::KeyboardModifier kbm = Qt::KeyboardModifier(mod);

Loading…
Cancel
Save