Changeset 4a2cffcccc9521265333d37f29697b890e28dcb5
- Timestamp:
- 01/06/07 23:47:38 (6 years ago)
- Author:
- Philipp Kern <phil@…>
- Parents:
- 47eacc32f1c58d8b7506672c4bf60f06a6b509bf
- Children:
- 5055ea175637d7bda2b21e59073ad1e102daad9e
- git-committer:
- Philipp Kern <phil@0x539.de> / 2007-01-06T22:47:38Z+0000
- Message:
-
[project @ Some more const-correctness]
Original author: Armin Burgmeier <armin@…>
Date: 2005-09-07 22:50:19+00:00
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rd7a5c00
|
r4a2cffc
|
|
| 47 | 47 | void obby_start(obby::local_buffer& buf); |
| 48 | 48 | void obby_end(); |
| 49 | | void obby_user_join(obby::user& user); |
| 50 | | void obby_user_part(obby::user& user); |
| | 49 | void obby_user_join(const obby::user& user); |
| | 50 | void obby_user_part(const obby::user& user); |
| 51 | 51 | void obby_document_insert(obby::local_document_info& document); |
| 52 | 52 | void obby_document_remove(obby::local_document_info& document); |
| 53 | 53 | |
| 54 | | void obby_message(obby::user& user, const Glib::ustring& message); |
| | 54 | void obby_message(const obby::user& user, const Glib::ustring& message); |
| 55 | 55 | void obby_server_message(const Glib::ustring& message); |
| 56 | 56 | protected: |
| 57 | | void add_line(obby::user& user, const Glib::ustring& message); |
| | 57 | void add_line(const obby::user& user, const Glib::ustring& message); |
| 58 | 58 | void on_chat(); |
| 59 | 59 | |
-
|
ra046a0c
|
r4a2cffc
|
|
| 138 | 138 | /** Calls from the folder. |
| 139 | 139 | */ |
| 140 | | void obby_user_join(obby::user& user); |
| 141 | | void obby_user_part(obby::user& user); |
| 142 | | void obby_user_colour(obby::user& user); |
| | 140 | void obby_user_join(const obby::user& user); |
| | 141 | void obby_user_part(const obby::user& user); |
| | 142 | void obby_user_colour(const obby::user& user); |
| 143 | 143 | |
| 144 | 144 | protected: |
| … |
… |
|
| 255 | 255 | const Gtk::TextBuffer::iterator& end); |
| 256 | 256 | |
| 257 | | void update_tag_colour(obby::user& user); |
| | 257 | void update_tag_colour(const obby::user& user); |
| 258 | 258 | }; |
| 259 | 259 | |
-
|
r5e8e3af
|
r4a2cffc
|
|
| 49 | 49 | /** Calls from the folder. |
| 50 | 50 | */ |
| 51 | | void obby_user_join(obby::user& user); |
| 52 | | void obby_user_part(obby::user& user); |
| 53 | | void obby_user_colour(obby::user& user); |
| | 51 | void obby_user_join(const obby::user& user); |
| | 52 | void obby_user_part(const obby::user& user); |
| | 53 | void obby_user_colour(const obby::user& user); |
| 54 | 54 | |
| 55 | 55 | protected: |
-
|
r42a0401
|
r4a2cffc
|
|
| 89 | 89 | void obby_start(obby::local_buffer& buf); |
| 90 | 90 | void obby_end(); |
| 91 | | void obby_user_join(obby::user& user); |
| 92 | | void obby_user_part(obby::user& user); |
| 93 | | void obby_user_colour(obby::user& user); |
| | 91 | void obby_user_join(const obby::user& user); |
| | 92 | void obby_user_part(const obby::user& user); |
| | 93 | void obby_user_colour(const obby::user& user); |
| 94 | 94 | void obby_document_insert(obby::local_document_info& document); |
| 95 | 95 | void obby_document_remove(obby::local_document_info& document); |
-
|
r39aa33b
|
r4a2cffc
|
|
| 102 | 102 | void obby_start(obby::local_buffer& buf); |
| 103 | 103 | void obby_end(); |
| 104 | | void obby_user_join(obby::user& user); |
| 105 | | void obby_user_part(obby::user& user); |
| | 104 | void obby_user_join(const obby::user& user); |
| | 105 | void obby_user_part(const obby::user& user); |
| 106 | 106 | void obby_document_insert(obby::local_document_info& document); |
| 107 | 107 | void obby_document_remove(obby::local_document_info& document); |
-
|
rd7a5c00
|
r4a2cffc
|
|
| 48 | 48 | void obby_start(obby::local_buffer& buf); |
| 49 | 49 | void obby_end(); |
| 50 | | void obby_user_join(obby::user& user); |
| 51 | | void obby_user_part(obby::user& user); |
| | 50 | void obby_user_join(const obby::user& user); |
| | 51 | void obby_user_part(const obby::user& user); |
| 52 | 52 | void obby_document_insert(obby::local_document_info& document); |
| 53 | 53 | void obby_document_remove(obby::local_document_info& document); |
-
|
r7bf4916
|
r4a2cffc
|
|
| 57 | 57 | virtual void obby_start(obby::local_buffer& buf); |
| 58 | 58 | virtual void obby_end(); |
| 59 | | virtual void obby_user_join(obby::user& user); |
| 60 | | virtual void obby_user_part(obby::user& user); |
| 61 | | virtual void obby_user_colour(obby::user& user); |
| | 59 | virtual void obby_user_join(const obby::user& user); |
| | 60 | virtual void obby_user_part(const obby::user& user); |
| | 61 | virtual void obby_user_colour(const obby::user& user); |
| 62 | 62 | virtual void obby_document_insert(obby::local_document_info& document); |
| 63 | 63 | virtual void obby_document_remove(obby::local_document_info& document); |
-
|
r9541de7
|
r4a2cffc
|
|
| 92 | 92 | void on_obby_close(); |
| 93 | 93 | |
| 94 | | void on_obby_user_join(obby::user& user); |
| 95 | | void on_obby_user_part(obby::user& user); |
| 96 | | void on_obby_user_colour(obby::user& user); |
| | 94 | void on_obby_user_join(const obby::user& user); |
| | 95 | void on_obby_user_part(const obby::user& user); |
| | 96 | void on_obby_user_colour(const obby::user& user); |
| 97 | 97 | void on_obby_user_colour_failed(); |
| 98 | 98 | void on_obby_document_insert(obby::document_info& document); |
| … |
… |
|
| 100 | 100 | |
| 101 | 101 | void on_obby_server_chat(const Glib::ustring& message); |
| 102 | | void on_obby_chat(obby::user& user, const Glib::ustring& message); |
| | 102 | void on_obby_chat(const obby::user& user, const Glib::ustring& message); |
| 103 | 103 | |
| 104 | 104 | // Helper functions |
-
|
r0c7664e
|
r4a2cffc
|
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | | void Gobby::Chat::obby_user_join(obby::user& user) |
| | 81 | void Gobby::Chat::obby_user_join(const obby::user& user) |
| 82 | 82 | { |
| 83 | 83 | obby::format_string str(_("%0% has joined") ); |
| … |
… |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | | void Gobby::Chat::obby_user_part(obby::user& user) |
| | 88 | void Gobby::Chat::obby_user_part(const obby::user& user) |
| 89 | 89 | { |
| 90 | 90 | obby::format_string str(_("%0% has left") ); |
| … |
… |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | | void Gobby::Chat::obby_message(obby::user& user, const Glib::ustring& message) |
| | 103 | void Gobby::Chat::obby_message(const obby::user& user, |
| | 104 | const Glib::ustring& message) |
| 104 | 105 | { |
| 105 | 106 | // Make sure we are not deceived by rogue multi line messages |
| … |
… |
|
| 113 | 114 | } |
| 114 | 115 | |
| 115 | | void Gobby::Chat::add_line(obby::user& user, const Glib::ustring& message) |
| | 116 | void Gobby::Chat::add_line(const obby::user& user, const Glib::ustring& message) |
| 116 | 117 | { |
| 117 | | obby::user& self = m_buffer->get_self(); |
| | 118 | const obby::user& self = m_buffer->get_self(); |
| 118 | 119 | Glib::ustring name = self.get_name(); |
| 119 | 120 | |
-
|
r47eacc3
|
r4a2cffc
|
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | | void Gobby::Document::obby_user_join(obby::user& user) |
| | 272 | void Gobby::Document::obby_user_join(const obby::user& user) |
| 273 | 273 | { |
| 274 | 274 | update_tag_colour(user); |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | | void Gobby::Document::obby_user_part(obby::user& user) |
| 278 | | { |
| 279 | | } |
| 280 | | |
| 281 | | void Gobby::Document::obby_user_colour(obby::user& user) |
| | 277 | void Gobby::Document::obby_user_part(const obby::user& user) |
| | 278 | { |
| | 279 | } |
| | 280 | |
| | 281 | void Gobby::Document::obby_user_colour(const obby::user& user) |
| 282 | 282 | { |
| 283 | 283 | update_tag_colour(user); |
| … |
… |
|
| 753 | 753 | } |
| 754 | 754 | |
| 755 | | void Gobby::Document::update_tag_colour(obby::user& user) |
| | 755 | void Gobby::Document::update_tag_colour(const obby::user& user) |
| 756 | 756 | { |
| 757 | 757 | // Build tag name for this user |
-
|
r5e8e3af
|
r4a2cffc
|
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | | void Gobby::DocWindow::obby_user_join(obby::user& user) |
| | 45 | void Gobby::DocWindow::obby_user_join(const obby::user& user) |
| 46 | 46 | { |
| 47 | 47 | m_doc.obby_user_join(user); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | | void Gobby::DocWindow::obby_user_part(obby::user& user) |
| | 50 | void Gobby::DocWindow::obby_user_part(const obby::user& user) |
| 51 | 51 | { |
| 52 | 52 | m_doc.obby_user_part(user); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | void Gobby::DocWindow::obby_user_colour(obby::user& user) |
| | 55 | void Gobby::DocWindow::obby_user_colour(const obby::user& user) |
| 56 | 56 | { |
| 57 | 57 | m_doc.obby_user_colour(user); |
-
|
r9ade3b3
|
r4a2cffc
|
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | | void Gobby::Folder::obby_user_join(obby::user& user) |
| | 139 | void Gobby::Folder::obby_user_join(const obby::user& user) |
| 140 | 140 | { |
| 141 | 141 | // Pass user join event to documents |
| … |
… |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | | void Gobby::Folder::obby_user_part(obby::user& user) |
| | 146 | void Gobby::Folder::obby_user_part(const obby::user& user) |
| 147 | 147 | { |
| 148 | 148 | // Pass user part event to documents |
| … |
… |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | | void Gobby::Folder::obby_user_colour(obby::user& user) |
| | 153 | void Gobby::Folder::obby_user_colour(const obby::user& user) |
| 154 | 154 | { |
| 155 | 155 | // Pass user colour event to documents |
-
|
r22dbf4a
|
r4a2cffc
|
|
| 627 | 627 | } |
| 628 | 628 | |
| 629 | | void Gobby::Header::obby_user_join(obby::user& user) |
| 630 | | { |
| 631 | | } |
| 632 | | |
| 633 | | void Gobby::Header::obby_user_part(obby::user& user) |
| | 629 | void Gobby::Header::obby_user_join(const obby::user& user) |
| | 630 | { |
| | 631 | } |
| | 632 | |
| | 633 | void Gobby::Header::obby_user_part(const obby::user& user) |
| 634 | 634 | { |
| 635 | 635 | } |
-
|
r47eacc3
|
r4a2cffc
|
|
| 282 | 282 | m_client = new client(window, addr); |
| 283 | 283 | #else |
| 284 | | m_client = new client(addr); |
| | 284 | m_net.reset(new client(addr) ); |
| 285 | 285 | #endif |
| 286 | 286 | register_signal_handlers(); |
| … |
… |
|
| 307 | 307 | net6::server* server = new io::server(port, false); |
| 308 | 308 | #endif |
| 309 | | m_server = server; |
| | 309 | m_net.reset(server); |
| 310 | 310 | |
| 311 | 311 | register_signal_handlers(); |
| … |
… |
|
| 337 | 337 | net6::host* host = new io::host(port, username, false); |
| 338 | 338 | #endif |
| 339 | | m_server = host; |
| 340 | | |
| 341 | | m_self = m_usertable.add_user(host->get_self(), red, green, blue); |
| | 339 | |
| | 340 | m_net.reset(host); |
| | 341 | |
| | 342 | m_self = m_user_table.add_user(host->get_self(), red, green, blue); |
| 342 | 343 | register_signal_handlers(); |
| 343 | 344 | } |
-
|
rab042e6
|
r4a2cffc
|
|
| 49 | 49 | void Gobby::JoinProgressDialog::on_thread() |
| 50 | 50 | { |
| | 51 | /*try |
| | 52 | { |
| | 53 | m_buffer.reset( |
| | 54 | new obby::io::client_buffer( |
| | 55 | #ifdef WIN32 |
| | 56 | m_parent, |
| | 57 | #endif |
| | 58 | m_hostname, |
| | 59 | m_port |
| | 60 | ) |
| | 61 | ); |
| | 62 | } |
| | 63 | catch(net6::error& e) |
| | 64 | { |
| | 65 | m_error = e.what(); |
| | 66 | }*/ |
| 51 | 67 | } |
| 52 | 68 | |
-
|
reba1437
|
r4a2cffc
|
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | | void Gobby::StatusBar::obby_user_join(obby::user& user) |
| | 121 | void Gobby::StatusBar::obby_user_join(const obby::user& user) |
| 122 | 122 | { |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | | void Gobby::StatusBar::obby_user_part(obby::user& user) |
| | 125 | void Gobby::StatusBar::obby_user_part(const obby::user& user) |
| 126 | 126 | { |
| 127 | 127 | } |
-
|
r7bf4916
|
r4a2cffc
|
|
| 109 | 109 | sigc::mem_fun(*this, &UserList::on_folder_tab_switched) ); |
| 110 | 110 | |
| | 111 | // UserList crashes with GTK+ 2.8.x if it gets too small and no entry |
| | 112 | set_size_request(200, 0); |
| 111 | 113 | } |
| 112 | 114 | |
| … |
… |
|
| 132 | 134 | } |
| 133 | 135 | |
| 134 | | void Gobby::UserList::obby_user_join(obby::user& user) |
| | 136 | void Gobby::UserList::obby_user_join(const obby::user& user) |
| 135 | 137 | { |
| 136 | 138 | // Is there already such a user? |
| … |
… |
|
| 148 | 150 | } |
| 149 | 151 | |
| 150 | | void Gobby::UserList::obby_user_part(obby::user& user) |
| | 152 | void Gobby::UserList::obby_user_part(const obby::user& user) |
| 151 | 153 | { |
| 152 | 154 | // User is not anymore connceted |
| … |
… |
|
| 155 | 157 | } |
| 156 | 158 | |
| 157 | | void Gobby::UserList::obby_user_colour(obby::user& user) |
| | 159 | void Gobby::UserList::obby_user_colour(const obby::user& user) |
| 158 | 160 | { |
| 159 | 161 | // Get user with this name |
-
|
ra4b0e8f
|
r4a2cffc
|
|
| 405 | 405 | m_local_file_path = " "; |
| 406 | 406 | // Create new document |
| 407 | | m_buffer->create_document(dlg.get_text() ); |
| | 407 | m_buffer->document_create(dlg.get_text(), "", false); |
| 408 | 408 | } |
| 409 | 409 | } |
| … |
… |
|
| 571 | 571 | // Simple ColorSelectionDialog |
| 572 | 572 | ColorSelectionDialog dlg; |
| 573 | | obby::user& user = m_buffer->get_self(); |
| | 573 | const obby::user& user = m_buffer->get_self(); |
| 574 | 574 | Gdk::Color color; |
| 575 | 575 | |
| … |
… |
|
| 691 | 691 | } |
| 692 | 692 | |
| 693 | | void Gobby::Window::on_obby_chat(obby::user& user, const Glib::ustring& message) |
| | 693 | void Gobby::Window::on_obby_chat(const obby::user& user, |
| | 694 | const Glib::ustring& message) |
| 694 | 695 | { |
| 695 | 696 | // Got chat message |
| … |
… |
|
| 703 | 704 | } |
| 704 | 705 | |
| 705 | | void Gobby::Window::on_obby_user_join(obby::user& user) |
| | 706 | void Gobby::Window::on_obby_user_join(const obby::user& user) |
| 706 | 707 | { |
| 707 | 708 | // Tell user join to components |
| … |
… |
|
| 713 | 714 | } |
| 714 | 715 | |
| 715 | | void Gobby::Window::on_obby_user_part(obby::user& user) |
| | 716 | void Gobby::Window::on_obby_user_part(const obby::user& user) |
| 716 | 717 | { |
| 717 | 718 | // Tell user part to components |
| … |
… |
|
| 723 | 724 | } |
| 724 | 725 | |
| 725 | | void Gobby::Window::on_obby_user_colour(obby::user& user) |
| | 726 | void Gobby::Window::on_obby_user_colour(const obby::user& user) |
| 726 | 727 | { |
| 727 | 728 | m_userlist.obby_user_colour(user); |
| … |
… |
|
| 861 | 862 | convert2unix(content); |
| 862 | 863 | |
| 863 | | m_buffer->create_document( |
| | 864 | m_buffer->document_create( |
| 864 | 865 | Glib::path_get_basename(file), content, open_as_edited |
| 865 | 866 | ); |
| … |
… |
|
| 941 | 942 | { |
| 942 | 943 | // Send remove document request |
| 943 | | m_buffer->remove_document( |
| | 944 | m_buffer->document_remove( |
| 944 | 945 | document.get_document().get_document() |
| 945 | 946 | ); |