Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Network
Konversation
Commits
7c6ed0b7
Commit
7c6ed0b7
authored
Jun 15, 2021
by
Laurent Montel
😁
Browse files
Modernize code (using clang-tidy)
parent
2670aa99
Changes
63
Hide whitespace changes
Inline
Side-by-side
src/application.cpp
View file @
7c6ed0b7
...
...
@@ -1019,7 +1019,7 @@ void Application::storeUrl(const QString& origin, const QString& newUrl, const Q
m_urlModel
->
setData
(
m_urlModel
->
index
(
0
,
0
),
origin
,
Qt
::
DisplayRole
);
m_urlModel
->
setData
(
m_urlModel
->
index
(
0
,
1
),
url
,
Qt
::
DisplayRole
);
UrlDateItem
*
dateItem
=
new
UrlDateItem
(
dateTime
);
auto
*
dateItem
=
new
UrlDateItem
(
dateTime
);
m_urlModel
->
setItem
(
0
,
2
,
dateItem
);
}
...
...
src/awaymanager.cpp
View file @
7c6ed0b7
...
...
@@ -157,7 +157,7 @@ void AwayManager::updateGlobalAwayAction(bool away)
simulateUserActivity
();
Application
*
konvApp
=
Application
::
instance
();
KToggleAction
*
awayAction
=
qobject_cast
<
KToggleAction
*>
(
konvApp
->
getMainWindow
()
->
actionCollection
()
->
action
(
QStringLiteral
(
"toggle_away"
)));
auto
*
awayAction
=
qobject_cast
<
KToggleAction
*>
(
konvApp
->
getMainWindow
()
->
actionCollection
()
->
action
(
QStringLiteral
(
"toggle_away"
)));
Konversation
::
TrayIcon
*
trayIcon
=
konvApp
->
getMainWindow
()
->
systemTrayIcon
();
if
(
!
awayAction
)
...
...
src/config/alias_config.cpp
View file @
7c6ed0b7
...
...
@@ -66,7 +66,7 @@ void Alias_Config::setAliasListView(const QStringList& aliasList)
for
(
int
index
=
aliasList
.
count
();
index
!=
0
;
index
--
)
{
QString
item
=
aliasList
[
index
-
1
];
QTreeWidgetItem
*
treeWidgetItem
=
new
QTreeWidgetItem
(
aliasListView
,
QStringList
{
auto
*
treeWidgetItem
=
new
QTreeWidgetItem
(
aliasListView
,
QStringList
{
item
.
section
(
QLatin1Char
(
' '
),
0
,
0
),
item
.
section
(
QLatin1Char
(
' '
),
1
)
});
...
...
@@ -154,7 +154,7 @@ void Alias_Config::actionChanged(const QString& newAction)
void
Alias_Config
::
addEntry
()
{
// add new item at the bottom of list view
QTreeWidgetItem
*
newItem
=
new
QTreeWidgetItem
(
aliasListView
,
aliasListView
->
topLevelItemCount
());
auto
*
newItem
=
new
QTreeWidgetItem
(
aliasListView
,
aliasListView
->
topLevelItemCount
());
if
(
newItem
)
{
...
...
src/config/autoreplace_config.cpp
View file @
7c6ed0b7
...
...
@@ -63,7 +63,7 @@ void Autoreplace_Config::setAutoreplaceListView(const QList<QStringList> &autore
// go through the list
for
(
const
QStringList
&
definition
:
autoreplaceList
)
{
// cut definition apart in name and action, and create a new listview item
QTreeWidgetItem
*
newItem
=
new
QTreeWidgetItem
(
patternListView
);
auto
*
newItem
=
new
QTreeWidgetItem
(
patternListView
);
newItem
->
setFlags
(
newItem
->
flags
()
&~
Qt
::
ItemIsDropEnabled
);
newItem
->
setCheckState
(
0
,
Qt
::
Unchecked
);
// Regular expression?
...
...
@@ -276,7 +276,7 @@ void Autoreplace_Config::replacementChanged(const QString& newReplacement)
void
Autoreplace_Config
::
addEntry
()
{
// add new item at the bottom of list view
QTreeWidgetItem
*
newItem
=
new
QTreeWidgetItem
(
patternListView
);
auto
*
newItem
=
new
QTreeWidgetItem
(
patternListView
);
if
(
newItem
)
{
...
...
src/config/configdialog.cpp
View file @
7c6ed0b7
...
...
@@ -197,11 +197,11 @@ KPageWidgetItem *ConfigDialog::ConfigDialogPrivate::addPageInternal(KPageWidgetI
const
QString
&
pixmapName
,
const
QString
&
header
)
{
QWidget
*
frame
=
new
QWidget
(
q
);
QVBoxLayo
ut
*
boxLayout
=
new
QVBoxLayout
(
frame
);
auto
*
frame
=
new
QWidget
(
q
);
a
ut
o
*
boxLayout
=
new
QVBoxLayout
(
frame
);
boxLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
QScrollArea
*
scroll
=
new
QScrollArea
(
q
);
auto
*
scroll
=
new
QScrollArea
(
q
);
scroll
->
setFrameShape
(
QFrame
::
NoFrame
);
scroll
->
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAsNeeded
);
scroll
->
setVerticalScrollBarPolicy
(
Qt
::
ScrollBarAsNeeded
);
...
...
@@ -210,7 +210,7 @@ KPageWidgetItem *ConfigDialog::ConfigDialogPrivate::addPageInternal(KPageWidgetI
scroll
->
setSizePolicy
(
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
MinimumExpanding
);
boxLayout
->
addWidget
(
scroll
);
KPageWidgetItem
*
item
=
new
KPageWidgetItem
(
frame
,
itemName
);
auto
*
item
=
new
KPageWidgetItem
(
frame
,
itemName
);
item
->
setHeader
(
header
);
if
(
!
pixmapName
.
isEmpty
())
{
item
->
setIcon
(
QIcon
::
fromTheme
(
pixmapName
));
...
...
src/config/highlight_config.cpp
View file @
7c6ed0b7
...
...
@@ -84,7 +84,7 @@ void Highlight_Config::loadSettings()
highlightListView
->
clear
();
const
auto
highlightList
=
Preferences
::
highlightList
();
for
(
Highlight
*
currentHighlight
:
highlightList
)
{
HighlightViewItem
*
item
=
new
HighlightViewItem
(
highlightListView
,
currentHighlight
);
auto
*
item
=
new
HighlightViewItem
(
highlightListView
,
currentHighlight
);
item
->
setFlags
(
item
->
flags
()
&~
Qt
::
ItemIsDropEnabled
);
}
...
...
@@ -107,7 +107,7 @@ void Highlight_Config::highlightSelected(QTreeWidgetItem* item)
if
(
item
)
{
// make a highlight item out of the generic qlistviewitem
HighlightViewItem
*
highlightItem
=
dynamic_cast
<
HighlightViewItem
*>
(
item
);
auto
*
highlightItem
=
dynamic_cast
<
HighlightViewItem
*>
(
item
);
// tell all now emitted signals that we just clicked on a new item, so they should
// not emit the modified() signal.
...
...
@@ -146,7 +146,7 @@ void Highlight_Config::updateButtons()
void
Highlight_Config
::
patternChanged
(
const
QString
&
newPattern
)
{
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
if
(
!
newItemSelected
&&
item
)
{
...
...
@@ -157,7 +157,7 @@ void Highlight_Config::patternChanged(const QString& newPattern)
void
Highlight_Config
::
notifyModeChanged
(
bool
enabled
)
{
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
if
(
!
newItemSelected
&&
item
)
{
...
...
@@ -168,7 +168,7 @@ void Highlight_Config::notifyModeChanged(bool enabled)
void
Highlight_Config
::
colorChanged
(
const
QColor
&
newColor
)
{
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
if
(
!
newItemSelected
&&
item
)
{
...
...
@@ -179,7 +179,7 @@ void Highlight_Config::colorChanged(const QColor& newColor)
void
Highlight_Config
::
soundURLChanged
(
const
QString
&
newURL
)
{
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
if
(
!
newItemSelected
&&
item
)
{
...
...
@@ -190,7 +190,7 @@ void Highlight_Config::soundURLChanged(const QString& newURL)
void
Highlight_Config
::
autoTextChanged
(
const
QString
&
newText
)
{
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
if
(
!
newItemSelected
&&
item
)
{
...
...
@@ -201,7 +201,7 @@ void Highlight_Config::autoTextChanged(const QString& newText)
void
Highlight_Config
::
chatWindowsChanged
(
const
QString
&
newChatWindows
)
{
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
if
(
!
newItemSelected
&&
item
)
{
...
...
@@ -212,9 +212,9 @@ void Highlight_Config::chatWindowsChanged(const QString& newChatWindows)
void
Highlight_Config
::
addHighlight
()
{
Highlight
*
newHighlight
=
new
Highlight
(
i18n
(
"New"
),
false
,
QColor
(
"#ff0000"
),
QUrl
(),
QString
(),
QString
(),
true
);
auto
*
newHighlight
=
new
Highlight
(
i18n
(
"New"
),
false
,
QColor
(
"#ff0000"
),
QUrl
(),
QString
(),
QString
(),
true
);
HighlightViewItem
*
item
=
new
HighlightViewItem
(
highlightListView
,
newHighlight
);
auto
*
item
=
new
HighlightViewItem
(
highlightListView
,
newHighlight
);
item
->
setFlags
(
item
->
flags
()
&~
Qt
::
ItemIsDropEnabled
);
highlightListView
->
setCurrentItem
(
item
);
patternInput
->
setFocus
();
...
...
@@ -224,7 +224,7 @@ void Highlight_Config::addHighlight()
void
Highlight_Config
::
removeHighlight
()
{
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
currentItem
());
if
(
item
)
{
...
...
@@ -246,7 +246,7 @@ QList<Highlight*> Highlight_Config::getHighlightList() const
{
QList
<
Highlight
*>
newList
;
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
topLevelItem
(
0
));
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
topLevelItem
(
0
));
while
(
item
)
{
newList
.
append
(
new
Highlight
(
item
->
getPattern
(),
item
->
getRegExp
(),
item
->
getColor
(),
...
...
@@ -261,7 +261,7 @@ QStringList Highlight_Config::currentHighlightList() const
{
QStringList
newList
;
HighlightViewItem
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
topLevelItem
(
0
));
auto
*
item
=
dynamic_cast
<
HighlightViewItem
*>
(
highlightListView
->
topLevelItem
(
0
));
while
(
item
)
{
newList
.
append
(
item
->
getPattern
()
+
QString
(
item
->
getRegExp
())
+
item
->
getColor
().
name
()
+
...
...
src/config/ignore_config.cpp
View file @
7c6ed0b7
...
...
@@ -79,8 +79,8 @@ QList<Ignore*> Ignore_Config::getIgnoreList() const
const
int
childCount
=
root
->
childCount
();
newList
.
reserve
(
childCount
);
for
(
int
i
=
0
;
i
<
childCount
;
++
i
)
{
IgnoreListViewItem
*
item
=
dynamic_cast
<
IgnoreListViewItem
*>
(
root
->
child
(
i
));
Ignore
*
newItem
=
new
Ignore
(
item
->
text
(
0
),
item
->
getFlags
());
auto
*
item
=
dynamic_cast
<
IgnoreListViewItem
*>
(
root
->
child
(
i
));
auto
*
newItem
=
new
Ignore
(
item
->
text
(
0
),
item
->
getFlags
());
newList
.
append
(
newItem
);
}
...
...
@@ -96,7 +96,7 @@ QStringList Ignore_Config::currentIgnoreList() const
const
int
childCount
=
root
->
childCount
();
newList
.
reserve
(
childCount
);
for
(
int
i
=
0
;
i
<
childCount
;
++
i
)
{
IgnoreListViewItem
*
item
=
dynamic_cast
<
IgnoreListViewItem
*>
(
root
->
child
(
i
));
auto
*
item
=
dynamic_cast
<
IgnoreListViewItem
*>
(
root
->
child
(
i
));
newList
.
append
(
item
->
text
(
0
)
+
QLatin1Char
(
' '
)
+
QString
(
item
->
getFlags
()));
}
...
...
@@ -139,7 +139,7 @@ void Ignore_Config::loadSettings()
void
Ignore_Config
::
updateEnabledness
()
{
IgnoreListViewItem
*
selectedItem
=
dynamic_cast
<
IgnoreListViewItem
*>
(
ignoreListView
->
currentItem
());
auto
*
selectedItem
=
dynamic_cast
<
IgnoreListViewItem
*>
(
ignoreListView
->
currentItem
());
chkChannel
->
setEnabled
(
selectedItem
!=
nullptr
);
chkQuery
->
setEnabled
(
selectedItem
!=
nullptr
);
...
...
@@ -157,7 +157,7 @@ void Ignore_Config::updateEnabledness()
void
Ignore_Config
::
select
(
QTreeWidgetItem
*
item
)
{
updateEnabledness
();
IgnoreListViewItem
*
selectedItem
=
dynamic_cast
<
IgnoreListViewItem
*>
(
item
);
auto
*
selectedItem
=
dynamic_cast
<
IgnoreListViewItem
*>
(
item
);
if
(
selectedItem
)
{
...
...
@@ -187,7 +187,7 @@ void Ignore_Config::flagCheckboxChanged()
if
(
chkInvite
->
isChecked
())
flags
|=
Ignore
::
Invite
;
// if(chkExceptions->isChecked()) flags |= Ignore::Exceptions;
IgnoreListViewItem
*
selectedItem
=
dynamic_cast
<
IgnoreListViewItem
*>
(
ignoreListView
->
currentItem
());
auto
*
selectedItem
=
dynamic_cast
<
IgnoreListViewItem
*>
(
ignoreListView
->
currentItem
());
if
(
selectedItem
)
{
selectedItem
->
setFlags
(
flags
);
selectedItem
->
setName
(
txtPattern
->
text
());
...
...
src/config/quickbuttons_config.cpp
View file @
7c6ed0b7
...
...
@@ -51,7 +51,7 @@ void QuickButtons_Config::setButtonsListView(const QStringList &buttonList)
buttonListView
->
clear
();
for
(
const
QString
&
definition
:
buttonList
)
{
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
(
buttonListView
,
QStringList
{
auto
*
item
=
new
QTreeWidgetItem
(
buttonListView
,
QStringList
{
definition
.
section
(
QLatin1Char
(
','
),
0
,
0
),
definition
.
section
(
QLatin1Char
(
','
),
1
)
});
...
...
@@ -190,7 +190,7 @@ void QuickButtons_Config::actionChanged(const QString& newAction)
void
QuickButtons_Config
::
addEntry
()
{
// add new item at the bottom of list view
QTreeWidgetItem
*
newItem
=
new
QTreeWidgetItem
(
buttonListView
,
buttonListView
->
topLevelItemCount
());
auto
*
newItem
=
new
QTreeWidgetItem
(
buttonListView
,
buttonListView
->
topLevelItemCount
());
if
(
newItem
)
{
...
...
src/config/settingsdialog.cpp
View file @
7c6ed0b7
...
...
@@ -43,15 +43,15 @@ KonviSettingsDialog::KonviSettingsDialog( QWidget *parent) :
m_modified
=
false
;
KPageWidgetItem
*
interfaceGroup
=
new
KPageWidgetItem
(
new
QWidget
(
this
),
i18n
(
"Interface"
));
auto
*
interfaceGroup
=
new
KPageWidgetItem
(
new
QWidget
(
this
),
i18n
(
"Interface"
));
interfaceGroup
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"preferences-desktop-theme"
)));
KPageDialog
::
addPage
(
interfaceGroup
);
KPageWidgetItem
*
behaviorGroup
=
new
KPageWidgetItem
(
new
QWidget
(
this
),
i18n
(
"Behavior"
));
auto
*
behaviorGroup
=
new
KPageWidgetItem
(
new
QWidget
(
this
),
i18n
(
"Behavior"
));
behaviorGroup
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"configure"
)));
KPageDialog
::
addPage
(
behaviorGroup
);
KPageWidgetItem
*
notificationGroup
=
new
KPageWidgetItem
(
new
QWidget
(
this
),
i18n
(
"Notifications"
));
auto
*
notificationGroup
=
new
KPageWidgetItem
(
new
QWidget
(
this
),
i18n
(
"Notifications"
));
notificationGroup
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"preferences-desktop-notification"
)));
KPageDialog
::
addPage
(
notificationGroup
);
...
...
@@ -101,7 +101,7 @@ KonviSettingsDialog::KonviSettingsDialog( QWidget *parent) :
konviAddSubPage
(
behaviorGroup
,
w
,
i18n
(
"General Behavior"
),
QStringLiteral
(
"configure"
));
//Behavior/Connection
ConnectionBehavior_Config
*
confConnectionBehavior
=
new
ConnectionBehavior_Config
(
this
);
auto
*
confConnectionBehavior
=
new
ConnectionBehavior_Config
(
this
);
confConnectionBehavior
->
setObjectName
(
QStringLiteral
(
"ConnectionBehavior"
));
konviAddSubPage
(
behaviorGroup
,
confConnectionBehavior
,
i18n
(
"Connection"
),
QStringLiteral
(
"network-connect"
));
m_pages
.
append
(
confConnectionBehavior
);
...
...
src/config/warnings_config.cpp
View file @
7c6ed0b7
...
...
@@ -208,7 +208,7 @@ void Warnings_Config::loadSettings()
const
char
*
const
message
(
warningDialogDefinition
.
message
);
const
char
*
const
ctx
(
warningDialogDefinition
.
context
);
QTreeWidgetItem
*
item
=
new
QTreeWidgetItem
(
dialogListView
);
auto
*
item
=
new
QTreeWidgetItem
(
dialogListView
);
item
->
setText
(
0
,
i18nc
(
ctx
,
message
));
item
->
setFlags
(
item
->
flags
()
|
Qt
::
ItemIsUserCheckable
);
item
->
setData
(
0
,
WarningNameRole
,
flagName
);
...
...
src/connectionmanager.cpp
View file @
7c6ed0b7
...
...
@@ -144,7 +144,7 @@ void ConnectionManager::connectTo(Konversation::ConnectionFlag flag, ConnectionS
Application
*
konvApp
=
Application
::
instance
();
MainWindow
*
mainWindow
=
konvApp
->
getMainWindow
();
Server
*
server
=
new
Server
(
this
,
settings
);
auto
*
server
=
new
Server
(
this
,
settings
);
enlistConnection
(
server
->
connectionId
(),
server
);
...
...
src/dcc/chatcontainer.cpp
View file @
7c6ed0b7
...
...
@@ -45,14 +45,14 @@ namespace Konversation
// setup layout
if
(
m_chat
->
extension
()
==
Chat
::
Whiteboard
)
{
QSplitter
*
chatSplitter
=
new
QSplitter
(
Qt
::
Vertical
);
auto
*
chatSplitter
=
new
QSplitter
(
Qt
::
Vertical
);
m_whiteBoard
=
new
WhiteBoard
(
chatSplitter
);
connect
(
m_whiteBoard
,
&
WhiteBoard
::
rawWhiteBoardCommand
,
m_chat
,
&
Chat
::
sendRawLine
);
connect
(
m_chat
,
&
Chat
::
connected
,
m_whiteBoard
,
&
WhiteBoard
::
connected
);
//chatSplitter->setStretchFactor(chatSplitter->indexOf(paintLabel), 1);
IRCViewBox
*
ircViewBox
=
new
IRCViewBox
(
chatSplitter
);
auto
*
ircViewBox
=
new
IRCViewBox
(
chatSplitter
);
//chatSplitter->setStretchFactor(chatSplitter->indexOf(ircViewBox), 1);
setTextView
(
ircViewBox
->
ircView
());
...
...
@@ -60,7 +60,7 @@ namespace Konversation
}
else
//(m_chat->extension() == Chat::SimpleChat || m_chat->extension() == Chat::Unknown)
{
IRCViewBox
*
ircViewBox
=
new
IRCViewBox
(
m_headerSplitter
);
auto
*
ircViewBox
=
new
IRCViewBox
(
m_headerSplitter
);
m_headerSplitter
->
setStretchFactor
(
m_headerSplitter
->
indexOf
(
ircViewBox
),
1
);
setTextView
(
ircViewBox
->
ircView
());
}
...
...
src/dcc/dcccommon.cpp
View file @
7c6ed0b7
...
...
@@ -133,7 +133,7 @@ namespace Konversation
QTcpServer
*
DccCommon
::
createServerSocketAndListen
(
QObject
*
parent
,
QString
*
failedReason
,
int
minPort
,
int
maxPort
)
{
QTcpServer
*
socket
=
new
QTcpServer
(
parent
);
auto
*
socket
=
new
QTcpServer
(
parent
);
if
(
minPort
>
0
&&
maxPort
>=
minPort
)
// ports are configured manually
{
...
...
src/dcc/dccfiledialog.cpp
View file @
7c6ed0b7
...
...
@@ -18,7 +18,7 @@
DccFileDialog
::
DccFileDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
)
{
QGridLayo
ut
*
mainLayout
=
new
QGridLayout
(
this
);
a
ut
o
*
mainLayout
=
new
QGridLayout
(
this
);
m_fileWidget
=
new
KFileWidget
(
QUrl
(),
this
);
mainLayout
->
addWidget
(
m_fileWidget
,
0
,
0
);
...
...
src/dcc/recipientdialog.cpp
View file @
7c6ed0b7
...
...
@@ -31,13 +31,13 @@ namespace Konversation
setModal
(
true
);
setWindowTitle
(
i18n
(
"Select Recipient"
)
);
// Add the layout to the widget
QVBoxLayo
ut
*
dialogLayout
=
new
QVBoxLayout
(
this
);
a
ut
o
*
dialogLayout
=
new
QVBoxLayout
(
this
);
// Add the nickname list widget
QSortFilterProxyModel
*
sortModel
=
new
QSortFilterProxyModel
(
this
);
auto
*
sortModel
=
new
QSortFilterProxyModel
(
this
);
sortModel
->
setSortCaseSensitivity
(
Preferences
::
self
()
->
sortCaseInsensitive
()
?
Qt
::
CaseInsensitive
:
Qt
::
CaseSensitive
);
sortModel
->
setSourceModel
(
model
);
sortModel
->
sort
(
0
,
Qt
::
AscendingOrder
);
QListView
*
nicknameList
=
new
QListView
(
this
);
auto
*
nicknameList
=
new
QListView
(
this
);
nicknameList
->
setUniformItemSizes
(
true
);
nicknameList
->
setModel
(
sortModel
);
...
...
@@ -49,7 +49,7 @@ namespace Konversation
connect
(
nicknameList
,
&
QListView
::
clicked
,
this
,
&
RecipientDialog
::
newNicknameSelected
);
connect
(
nicknameList
,
&
QListView
::
doubleClicked
,
this
,
&
RecipientDialog
::
newNicknameSelectedQuit
);
QDialogButtonBox
*
buttonBox
=
new
QDialogButtonBox
(
this
);
auto
*
buttonBox
=
new
QDialogButtonBox
(
this
);
dialogLayout
->
addWidget
(
buttonBox
);
QPushButton
*
button
=
buttonBox
->
addButton
(
QDialogButtonBox
::
Ok
);
button
->
setToolTip
(
i18n
(
"Select nickname and close the window"
));
...
...
src/dcc/resumedialog.cpp
View file @
7c6ed0b7
...
...
@@ -75,10 +75,10 @@ namespace Konversation
setWindowTitle
(
caption
);
setModal
(
true
);
QVBoxLayo
ut
*
mainLayout
=
new
QVBoxLayout
;
a
ut
o
*
mainLayout
=
new
QVBoxLayout
;
setLayout
(
mainLayout
);
QLabel
*
labelMessage
=
new
QLabel
(
this
);
auto
*
labelMessage
=
new
QLabel
(
this
);
labelMessage
->
setText
(
message
);
m_urlreqFileURL
=
new
KUrlRequester
(
m_item
->
getFileURL
(),
this
);
...
...
@@ -90,11 +90,11 @@ namespace Konversation
if
(
m_enabledActions
&
RA_Rename
)
{
QFrame
*
filePathToolsFrame
=
new
QFrame
(
this
);
QHBoxLayo
ut
*
filePathToolsLayout
=
new
QHBoxLayout
(
filePathToolsFrame
);
auto
*
filePathToolsFrame
=
new
QFrame
(
this
);
a
ut
o
*
filePathToolsLayout
=
new
QHBoxLayout
(
filePathToolsFrame
);
QPushBut
to
n
*
btnDefaultName
=
new
QPushButton
(
i18n
(
"O&riginal Filename"
),
filePathToolsFrame
);
QPushBut
to
n
*
btnSuggestNewName
=
new
QPushButton
(
i18n
(
"Suggest &New Filename"
),
filePathToolsFrame
);
au
to
*
btnDefaultName
=
new
QPushButton
(
i18n
(
"O&riginal Filename"
),
filePathToolsFrame
);
au
to
*
btnSuggestNewName
=
new
QPushButton
(
i18n
(
"Suggest &New Filename"
),
filePathToolsFrame
);
filePathToolsLayout
->
addItem
(
new
QSpacerItem
(
0
,
0
,
QSizePolicy
::
Expanding
));
filePathToolsLayout
->
addWidget
(
btnDefaultName
);
filePathToolsLayout
->
addWidget
(
btnSuggestNewName
);
...
...
@@ -105,8 +105,8 @@ namespace Konversation
}
if
(
m_enabledActions
&
RA_OverwriteDefaultPath
)
{
QFrame
*
settingsFrame
=
new
QFrame
(
this
);
QVBoxLayo
ut
*
settingsLayout
=
new
QVBoxLayout
(
settingsFrame
);
auto
*
settingsFrame
=
new
QFrame
(
this
);
a
ut
o
*
settingsLayout
=
new
QVBoxLayout
(
settingsFrame
);
m_overwriteDefaultPathCheckBox
=
new
QCheckBox
(
i18n
(
"Use as new default download folder"
),
settingsFrame
);
settingsLayout
->
addWidget
(
m_overwriteDefaultPathCheckBox
);
...
...
src/dcc/transfer.h
View file @
7c6ed0b7
...
...
@@ -22,7 +22,7 @@ namespace Konversation
{
namespace
DCC
{
typedef
qreal
transferspeed_t
;
using
transferspeed_t
=
qreal
;
class
Transfer
:
public
QObject
{
...
...
src/dcc/transferdetailedinfopanel.cpp
View file @
7c6ed0b7
...
...
@@ -27,7 +27,7 @@ namespace Konversation
TransferDetailedInfoPanel
::
TransferDetailedInfoPanel
(
QWidget
*
parent
)
:
QTabWidget
(
parent
)
{
QWidget
*
tab
=
new
QWidget
(
this
);
auto
*
tab
=
new
QWidget
(
this
);
m_locationInfo
.
setupUi
(
tab
);
addTab
(
tab
,
i18n
(
"Status"
)
);
tab
=
new
QWidget
(
this
);
...
...
src/dcc/transfermanager.cpp
View file @
7c6ed0b7
...
...
@@ -97,7 +97,7 @@ namespace Konversation
TransferRecv
*
TransferManager
::
newDownload
()
{
TransferRecv
*
transfer
=
new
TransferRecv
(
this
);
auto
*
transfer
=
new
TransferRecv
(
this
);
m_recvItems
.
push_back
(
transfer
);
connect
(
transfer
,
&
TransferRecv
::
removed
,
this
,
&
TransferManager
::
removeRecvItem
);
initTransfer
(
transfer
);
...
...
@@ -106,7 +106,7 @@ namespace Konversation
TransferSend
*
TransferManager
::
newUpload
()
{
TransferSend
*
transfer
=
new
TransferSend
(
this
);
auto
*
transfer
=
new
TransferSend
(
this
);
m_sendItems
.
push_back
(
transfer
);
connect
(
transfer
,
&
TransferSend
::
removed
,
this
,
&
TransferManager
::
removeSendItem
);
initTransfer
(
transfer
);
...
...
@@ -378,14 +378,14 @@ namespace Konversation
void
TransferManager
::
removeSendItem
(
Transfer
*
item
)
{
TransferSend
*
transfer
=
qobject_cast
<
TransferSend
*
>
(
item
);
auto
*
transfer
=
qobject_cast
<
TransferSend
*
>
(
item
);
m_sendItems
.
removeOne
(
transfer
);
item
->
deleteLater
();
}
void
TransferManager
::
removeRecvItem
(
Transfer
*
item
)
{
TransferRecv
*
transfer
=
qobject_cast
<
TransferRecv
*
>
(
item
);
auto
*
transfer
=
qobject_cast
<
TransferRecv
*
>
(
item
);
m_recvItems
.
removeOne
(
transfer
);
item
->
deleteLater
();
}
...
...
src/dcc/transferpanel.cpp
View file @
7c6ed0b7
...
...
@@ -206,7 +206,7 @@ namespace Konversation
if
(
index
.
isValid
())
{
Transfer
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
auto
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
if
(
transfer
)
{
m_detailPanel
->
setTransfer
(
transfer
);
...
...
@@ -221,7 +221,7 @@ namespace Konversation
if
(
index
.
data
(
TransferListModel
::
TransferType
).
toInt
()
==
Transfer
::
Receive
&&
index
.
data
(
TransferListModel
::
TransferStatus
).
toInt
()
==
Transfer
::
Queued
)
{
Transfer
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
auto
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
if
(
transfer
)
{
transfer
->
start
();
...
...
@@ -237,7 +237,7 @@ namespace Konversation
for
(
const
QModelIndex
&
index
:
selectedRowIndices
)
{
if
(
index
.
data
(
TransferListModel
::
TransferStatus
).
toInt
()
<
Transfer
::
Done
)
{
Transfer
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
auto
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
if
(
transfer
)
{
transfer
->
abort
();
...
...
@@ -255,7 +255,7 @@ namespace Konversation
if
(
index
.
data
(
TransferListModel
::
TransferType
).
toInt
()
==
Transfer
::
Send
&&
index
.
data
(
TransferListModel
::
TransferStatus
).
toInt
()
>=
Transfer
::
Done
)
{
Transfer
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
auto
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
if
(
!
transfer
)
{
continue
;
...
...
@@ -442,7 +442,7 @@ namespace Konversation
if
(
index
.
data
(
TransferListModel
::
TransferType
).
toInt
()
==
Transfer
::
Send
||
index
.
data
(
TransferListModel
::
TransferStatus
).
toInt
()
==
Transfer
::
Done
)
{
Transfer
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
auto
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
if
(
transfer
)
{
transfer
->
runFile
();
...
...
@@ -455,7 +455,7 @@ namespace Konversation
{
const
auto
selectedRowIndices
=
m_transferView
->
selectedRows
();
for
(
const
QModelIndex
&
index
:
selectedRowIndices
)
{
Transfer
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
auto
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
if
(
transfer
)
{
openLocation
(
transfer
);
...
...
@@ -483,7 +483,7 @@ namespace Konversation
void
TransferPanel
::
doubleClicked
(
const
QModelIndex
&
index
)
{
Transfer
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
auto
*
transfer
=
qobject_cast
<
Transfer
*>
(
index
.
data
(
TransferListModel
::
TransferPointer
).
value
<
QObject
*>
());
if
(
transfer
)
{
transfer
->
runFile
();
...
...
Prev
1
2
3
4
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment