Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Themes commit-by-commit part 1 #7566

Merged
merged 2 commits into from Oct 11, 2017
Merged

Themes commit-by-commit part 1 #7566

merged 2 commits into from Oct 11, 2017

Conversation

zeule
Copy link
Contributor

@zeule zeule commented Oct 10, 2017

As per discussion in #6698 I'm splitting that PR onto smaller ones. Here is the first part. No functional changes here, just code formatting and refactoring,

@@ -36,10 +36,7 @@ typedef QSet<QString> QStringSet;

namespace BitTorrent
{

class TorrentHandle;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indent this line.

@@ -1459,10 +1464,9 @@ void Preferences::upgrade()
QStringList labels = value("TransferListFilters/customLabels").toStringList();
if (!labels.isEmpty()) {
QVariantMap categories = value("BitTorrent/Session/Categories").toMap();
foreach (const QString &label, labels) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was no violation of the coding style, so this is a purely subjective change...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we shouldn't accept such changes. Otherwise, everyone will do some unrelated changes, just formatting some code snippets in its own way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Reverted.

@@ -59,7 +59,7 @@

Preferences *Preferences::m_instance = 0;

Preferences::Preferences() {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question only for my interest... Why is the new version (with default) better than the former (with empty body)?

Copy link
Contributor Author

@zeule zeule Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to give more coding flexibility and less format violation options.

@@ -264,6 +264,7 @@ void Preferences::setWinStartup(bool b)
settings.remove("qBittorrent");
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these blank lines?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evsh, I used plural form... there are some other similar blank lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@@ -34,6 +34,8 @@
#include <QElapsedTimer>
#include <QVariant>

#include <libtorrent/version.hpp>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need this later?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -227,6 +229,52 @@ static const char KEY_LOG_PEER_REASON[] = "reason";

namespace
{
QString torrentStateToString(BitTorrent::TorrentState state)
Copy link
Member

@Chocobo1 Chocobo1 Oct 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we take const BitTorrent::TorrentState state please?

everything else is fine, just curious.

@@ -740,6 +740,7 @@ void Preferences::useSystemIconTheme(bool enabled)
{
setValue("Preferences/Advanced/useSystemIconTheme", enabled);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uncrustify did this?

@@ -117,6 +117,7 @@ QIcon GuiIconProvider::generateDifferentSizes(const QIcon &icon)

return newIcon;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this one.

@@ -1459,10 +1464,9 @@ void Preferences::upgrade()
QStringList labels = value("TransferListFilters/customLabels").toStringList();
if (!labels.isEmpty()) {
QVariantMap categories = value("BitTorrent/Session/Categories").toMap();
foreach (const QString &label, labels) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we shouldn't accept such changes. Otherwise, everyone will do some unrelated changes, just formatting some code snippets in its own way.

magao and others added 2 commits October 10, 2017 21:28
This is needed to forward declare this type and pass it by value.

Conversion from/to QVariant are hanled via Q_DECLARE_METATYPE, while
TorrentState::toString() function was used in webui only and as such is
moved there.
@zeule
Copy link
Contributor Author

zeule commented Oct 11, 2017

Thanks!

@zeule zeule merged commit 7a652c0 into qbittorrent:master Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants