mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
Improve coding style
This commit is contained in:
@@ -43,8 +43,10 @@ QList<QNetworkCookie> CookiesModel::cookies() const
|
||||
|
||||
QVariant CookiesModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||
{
|
||||
if ((role == Qt::DisplayRole) && (orientation == Qt::Horizontal)) {
|
||||
switch (section) {
|
||||
if ((role == Qt::DisplayRole) && (orientation == Qt::Horizontal))
|
||||
{
|
||||
switch (section)
|
||||
{
|
||||
case COL_DOMAIN:
|
||||
return tr("Domain");
|
||||
case COL_PATH:
|
||||
@@ -96,7 +98,8 @@ QVariant CookiesModel::data(const QModelIndex &index, int role) const
|
||||
|| ((role != Qt::DisplayRole) && (role != Qt::EditRole)))
|
||||
return {};
|
||||
|
||||
switch (index.column()) {
|
||||
switch (index.column())
|
||||
{
|
||||
case COL_DOMAIN:
|
||||
return m_cookies[index.row()].domain();
|
||||
case COL_PATH:
|
||||
@@ -116,7 +119,8 @@ bool CookiesModel::setData(const QModelIndex &index, const QVariant &value, int
|
||||
{
|
||||
if (role != Qt::EditRole) return false;
|
||||
|
||||
switch (index.column()) {
|
||||
switch (index.column())
|
||||
{
|
||||
case COL_DOMAIN:
|
||||
m_cookies[index.row()].setDomain(value.toString());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user