-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add button for sending test email #20488
Conversation
What's the point? It has no parameters and it isn't supposed to change the state of the application. |
Make |
BTW, it looks like a really good idea to be able to send a test email with the currently entered settings without requiring them to be applied. Otherwise, the user may be confused. |
It is submitting a request to do something, not just fetching some data/resources. |
Ok. |
That paragraph was copied from the original PR. I consider it a good idea too but I would not like to do it in this PR due to the last PR was already approved in this state.
I don't mind but I hope I can leave it for others to handle it. |
I thought it was initially introduced in this PR. Apparently, I overlooked it in the original PR. So OK, let's leave it for another day. |
Hmm, I would much prefer to merge my original PR than to have my contribution attributed to someone else. Is this now standard procedure in this repo? |
You are still the author: 0fd7fce If you insist I'll reopen yours and close mine. But do mind there are unresolved comments (and merge conflicts) in the original PR.
We sometimes 'help'/adopt other PRs in case the original author is not responsive or the required changes is too much. |
Why do you think that "my contribution attributed to someone else"? It still contains the commit that is authored by you. And it is you who will be mentioned in the changelog. |
My mistake, I didn't realize the commit was still attributed to me. |
@glassez |
@glassez @sledgehammer999 |
IIRC, GitHub assigns the PR author as the author of the squashed commit (so there are no problems with "squash and merge" original PRs). |
I don't mind using 'rebase and merge' in this case if you first insert |
This allows for easily testing whether the provided email configuration is correct. PR qbittorrent#20488.
Done. |
+ tr("Thank you for using qBittorrent.") + u'\n'; | ||
|
||
// Send the notification email | ||
auto *smtp = new Net::Smtp(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not passing a parent
to the constructor, so this is going to leak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind - Smtp
is set to call deleteLater
when its socket disconnects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're not passing a parent to the constructor, so this is going to leak.
(clarification: the code was from #20194) You are probably right. It will happen when the procedure is still running and user exited qbt. Also Smtp
destructor seems to be missing closing the socket.
Do you mind submitting a patch?
Also note this:
qBittorrent/src/base/net/smtp.cpp
Line 122 in c06817f
connect(m_socket, &QAbstractSocket::disconnected, this, &QObject::deleteLater); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will happen when the procedure is still running and user exited qbt.
What will happen?
Also
Smtp
destructor seems to be missing closing the socket.
Socket is closed in its destructor which is called by Smtp destructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I still find it a confusing design when an explicitly created object destroys itself "without the knowledge of its creator/owner".
This is re-submission of PR #20194 due to the author of #20194 wasn't responsive.
This allows for easily testing whether the provided email configuration is correct. Testing otherwise requires downloading a torrent until completion.
Note that the email is sent using the values currently saved to the config file; NOT necessarily the information currently entered into the options dialog. I'm open to ideas on how to make this more apparent to the user.