mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 20:56:17 +00:00
Compare commits
4 Commits
v0.16.23
...
c32b56e9d8
| Author | SHA1 | Date | |
|---|---|---|---|
| c32b56e9d8 | |||
| de54a4c2ad | |||
| 26fdca8f4d | |||
| 00bcdaee23 |
@@ -431,6 +431,9 @@ p_call_target(const torrent::Object::list_type& args) {
|
|||||||
const std::string& peer_id = itr++->as_string();
|
const std::string& peer_id = itr++->as_string();
|
||||||
const std::string& command_key = itr++->as_string();
|
const std::string& command_key = itr++->as_string();
|
||||||
|
|
||||||
|
if (download == nullptr)
|
||||||
|
throw torrent::input_error("invalid parameters: info-hash not found");
|
||||||
|
|
||||||
torrent::HashString hash;
|
torrent::HashString hash;
|
||||||
|
|
||||||
if (peer_id.size() != 40)
|
if (peer_id.size() != 40)
|
||||||
|
|||||||
+2
-2
@@ -216,7 +216,7 @@ View::set_not_visible(Download* download) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
View::next_focus(unsigned int i) {
|
View::next_focus(unsigned int i) {
|
||||||
if (empty())
|
if (empty_visible())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If at the boundary, roll over
|
// If at the boundary, roll over
|
||||||
@@ -239,7 +239,7 @@ View::next_focus(unsigned int i) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
View::prev_focus(unsigned int i) {
|
View::prev_focus(unsigned int i) {
|
||||||
if (empty())
|
if (empty_visible())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// If at the boundary, roll over
|
// If at the boundary, roll over
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ WindowFileList::WindowFileList(const ui::ElementFileList* element) :
|
|||||||
// Convert std::string to std::wstring of given width (in screen positions),
|
// Convert std::string to std::wstring of given width (in screen positions),
|
||||||
// taking into account that some characters may be occupying two screen positions.
|
// taking into account that some characters may be occupying two screen positions.
|
||||||
std::wstring
|
std::wstring
|
||||||
wstring_width(const std::string& i_str, [[maybe_unused]] int width) {
|
wstring_width(const std::string& i_str, int width) {
|
||||||
|
if (width < 0)
|
||||||
|
width = 0;
|
||||||
|
|
||||||
std::wstring result(width + 1, L' ');
|
std::wstring result(width + 1, L' ');
|
||||||
size_t length = std::mbstowcs(result.data(), i_str.c_str(), width);
|
size_t length = std::mbstowcs(result.data(), i_str.c_str(), width);
|
||||||
|
|
||||||
|
|||||||
@@ -61,14 +61,20 @@ CommandScheduler::call_item(value_type item) {
|
|||||||
// Remove the item before calling the command if it should be
|
// Remove the item before calling the command if it should be
|
||||||
// removed.
|
// removed.
|
||||||
|
|
||||||
|
std::string key = item->key();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
rpc::call_object(item->command());
|
rpc::call_object(item->command());
|
||||||
|
|
||||||
} catch (torrent::input_error& e) {
|
} catch (torrent::input_error& e) {
|
||||||
if (m_slotErrorMessage)
|
if (m_slotErrorMessage)
|
||||||
m_slotErrorMessage("Scheduled command failed: " + item->key() + ": " + e.what());
|
m_slotErrorMessage("Scheduled command failed: " + key + ": " + e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The command is allowed to erase or replace this item, which deletes it.
|
||||||
|
if (std::find(begin(), end(), item) == end())
|
||||||
|
return;
|
||||||
|
|
||||||
// Still schedule if we caught a torrrent::input_error?
|
// Still schedule if we caught a torrrent::input_error?
|
||||||
auto next = item->next_time_scheduled();
|
auto next = item->next_time_scheduled();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user