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

Fix return types #34

Merged
merged 4 commits into from Feb 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/aamanager.cpp
Expand Up @@ -227,13 +227,13 @@ void AAManager::save_history()


// ラベル、AA取得
const std::string AAManager::get_label( const int id )
std::string AAManager::get_label( const int id )
{
if( id >= (int) m_vec_label.size() ) return std::string();
return m_vec_label[ id ];
}

const std::string AAManager::get_aa( const int id )
std::string AAManager::get_aa( const int id )
{
if( id >= (int) m_vec_aa.size() ) return std::string();
return m_vec_aa[ id ];
Expand All @@ -243,7 +243,7 @@ const std::string AAManager::get_aa( const int id )
//
// ショートカットキー取得
//
const std::string AAManager::id2shortcut( const int id )
std::string AAManager::id2shortcut( const int id )
{
if( id >= (int) m_map_shortcut.size() ) return std::string();

Expand Down
6 changes: 3 additions & 3 deletions src/aamanager.h
Expand Up @@ -29,11 +29,11 @@ namespace CORE
int get_size(){ return m_vec_label.size(); }
int get_historysize(){ return m_history.size(); }

const std::string get_label( const int id );
const std::string get_aa( const int id );
std::string get_label( const int id );
std::string get_aa( const int id );

// ショートカットキー取得
const std::string id2shortcut( const int id );
std::string id2shortcut( const int id );

// ショートカットからid取得
int shortcut2id( const char key );
Expand Down
2 changes: 1 addition & 1 deletion src/article/articleadmin.cpp
Expand Up @@ -362,7 +362,7 @@ COMMAND_ARGS ArticleAdmin::url_to_openarg( const std::string& url, const bool ta
}


const std::string ArticleAdmin::command_to_url( const COMMAND_ARGS& command )
std::string ArticleAdmin::command_to_url( const COMMAND_ARGS& command )
{
std::string url;

Expand Down
2 changes: 1 addition & 1 deletion src/article/articleadmin.h
Expand Up @@ -52,7 +52,7 @@ namespace ARTICLE

void restore( const bool only_locked ) override;
COMMAND_ARGS url_to_openarg( const std::string& url, const bool tab, const bool lock ) override;
const std::string command_to_url( const COMMAND_ARGS& command ) override;
std::string command_to_url( const COMMAND_ARGS& command ) override;

void switch_admin() override;

Expand Down
6 changes: 3 additions & 3 deletions src/article/articleviewbase.cpp
Expand Up @@ -120,7 +120,7 @@ SKELETON::Admin* ArticleViewBase::get_admin()
//
// メインウィンドウのURLバーなどの表示用にも使う
//
const std::string ArticleViewBase::url_for_copy()
std::string ArticleViewBase::url_for_copy()
{
return DBTREE::url_readcgi( m_url_article, 0, 0 );
}
Expand Down Expand Up @@ -470,7 +470,7 @@ void ArticleViewBase::setup_action()
//
// 通常の右クリックメニューの作成
//
const std::string ArticleViewBase::create_context_menu()
std::string ArticleViewBase::create_context_menu()
{
std::list< int > list_menu;

Expand Down Expand Up @@ -1600,7 +1600,7 @@ void ArticleViewBase::slot_setup_abone_all()
//
// 荒らし報告用のURLリストをHTML形式で取得
//
const std::string ArticleViewBase::get_html_url4report( const std::list< int >& list_resnum )
std::string ArticleViewBase::get_html_url4report( const std::list< int >& list_resnum )
{
std::string html;

Expand Down
6 changes: 3 additions & 3 deletions src/article/articleviewbase.h
Expand Up @@ -102,7 +102,7 @@ namespace ARTICLE

void save_session() override {}

const std::string url_for_copy() override; // コピーやURLバー表示用のURL
std::string url_for_copy() override; // コピーやURLバー表示用のURL
int width_client() override;
int height_client() override;
int get_icon( const std::string& iconname ) override;
Expand Down Expand Up @@ -246,7 +246,7 @@ namespace ARTICLE
void setup_action();

// 通常の右クリックメニューの作成
const std::string create_context_menu();
std::string create_context_menu();
const char* get_menu_item( const int item );

virtual void exec_reload();
Expand All @@ -255,7 +255,7 @@ namespace ARTICLE
void exec_delete();

// 荒らし報告用のURLリストをHTML形式で取得
const std::string get_html_url4report( const std::list< int >& list_resnum );
std::string get_html_url4report( const std::list< int >& list_resnum );

// drawarea の signal を受け取る slots
virtual bool slot_button_press( std::string url, int res_number, GdkEventButton* event );
Expand Down
4 changes: 2 additions & 2 deletions src/article/articleviewsearch.cpp
Expand Up @@ -117,7 +117,7 @@ void ArticleViewSearch::set_toolbar_from_url()
// queryが変化したときにurlを更新しないと再起動したときのrestoreで
// 古いqueryのままになる
//
const std::string ArticleViewSearch::get_new_url()
std::string ArticleViewSearch::get_new_url()
{
std::string url_tmp = m_url_board;

Expand Down Expand Up @@ -186,7 +186,7 @@ void ArticleViewSearch::regex_escape()
//
// メインウィンドウのURLバーなどの表示用にも使う
//
const std::string ArticleViewSearch::url_for_copy()
std::string ArticleViewSearch::url_for_copy()
{
if( m_searchmode == CORE::SEARCHMODE_TITLE ) return m_url_title;

Expand Down
4 changes: 2 additions & 2 deletions src/article/articleviewsearch.h
Expand Up @@ -35,7 +35,7 @@ namespace ARTICLE

// SKELETON::View の関数のオーバロード

const std::string url_for_copy() override; // コピーやURLバー表示用のURL
std::string url_for_copy() override; // コピーやURLバー表示用のURL
bool set_command( const std::string& command,
const std::string& arg1 = {},
const std::string& arg2 = {} ) override;
Expand Down Expand Up @@ -65,7 +65,7 @@ namespace ARTICLE
void set_toolbar_from_url();

// queryなどを変更した時の新しいURL
const std::string get_new_url();
std::string get_new_url();

// ラベルやタブを更新
void update_label();
Expand Down
2 changes: 1 addition & 1 deletion src/article/drawareabase.cpp
Expand Up @@ -592,7 +592,7 @@ int DrawAreaBase::get_current_res_num()


// 範囲選択中の文字列
const std::string DrawAreaBase::str_selection()
std::string DrawAreaBase::str_selection()
{
if( ! m_selection.select ) return std::string();

Expand Down
6 changes: 3 additions & 3 deletions src/article/drawareabase.h
Expand Up @@ -251,8 +251,8 @@ namespace ARTICLE
~DrawAreaBase();

const std::string& get_url() const { return m_url; }
const int& width_client() const { return m_width_client; }
const int& height_client() const { return m_height_client; }
int width_client() const { return m_width_client; }
int height_client() const { return m_height_client; }

void clock_in();
void clock_in_smooth_scroll();
Expand Down Expand Up @@ -280,7 +280,7 @@ namespace ARTICLE
void select_all();

// 範囲選択中の文字列
const std::string str_selection();
std::string str_selection();
const std::string& str_pre_selection() const { return m_selection.str_pre; } // 一つ前の選択文字列

// 範囲選択を開始したレス番号
Expand Down
8 changes: 4 additions & 4 deletions src/bbslist/addetcdialog.h
Expand Up @@ -25,10 +25,10 @@ namespace BBSLIST

AddEtcDialog( const bool move, const std::string& url, const std::string& _name, const std::string& _id, const std::string& _passwd );

const std::string get_name(){ return m_entry_name.get_text(); }
const std::string get_url(){ return m_entry_url.get_text(); }
const std::string get_id(){ return m_entry_id.get_text(); }
const std::string get_passwd(){ return m_entry_pw.get_text(); }
std::string get_name() const { return m_entry_name.get_text(); }
std::string get_url() const { return m_entry_url.get_text(); }
std::string get_id() const { return m_entry_id.get_text(); }
std::string get_passwd() const { return m_entry_pw.get_text(); }
};

}
Expand Down
2 changes: 1 addition & 1 deletion src/bbslist/bbslistadmin.cpp
Expand Up @@ -275,7 +275,7 @@ void BBSListAdmin::get_threads( const std::string& url, const int dirid, std::ve


// サイドバーの指定したidのディレクトリの名前を取得
const std::string BBSListAdmin::get_dirname( const std::string& url, const int dirid )
std::string BBSListAdmin::get_dirname( const std::string& url, const int dirid )
{
BBSListViewBase* view = dynamic_cast< BBSListViewBase* >( get_view( url ) );
if( view ) return view->get_dirname( dirid );
Expand Down
2 changes: 1 addition & 1 deletion src/bbslist/bbslistadmin.h
Expand Up @@ -41,7 +41,7 @@ namespace BBSLIST
void get_threads( const std::string& url, const int dirid, std::vector< std::string >& list_url );

// サイドバーの指定したidのディレクトリの名前を取得
const std::string get_dirname( const std::string& url, const int dirid );
std::string get_dirname( const std::string& url, const int dirid );

protected:

Expand Down
12 changes: 6 additions & 6 deletions src/bbslist/bbslistviewbase.cpp
Expand Up @@ -2060,7 +2060,7 @@ void BBSListViewBase::slot_sort( const int mode )
//
// path -> url 変換
//
const Glib::ustring BBSListViewBase::path2rawurl( const Gtk::TreePath& path )
Glib::ustring BBSListViewBase::path2rawurl( const Gtk::TreePath& path )
{
Gtk::TreeModel::Row row = m_treeview.get_row( path );
if( !row ) return Glib::ustring();
Expand All @@ -2070,7 +2070,7 @@ const Glib::ustring BBSListViewBase::path2rawurl( const Gtk::TreePath& path )


// 移転をチェックするバージョン
const Glib::ustring BBSListViewBase::path2url( const Gtk::TreePath& path )
Glib::ustring BBSListViewBase::path2url( const Gtk::TreePath& path )
{
Gtk::TreeModel::Row row = m_treeview.get_row( path );
if( !row ) return Glib::ustring();
Expand Down Expand Up @@ -2104,7 +2104,7 @@ const Glib::ustring BBSListViewBase::path2url( const Gtk::TreePath& path )
// 板の場合は boardbase
// スレの場合は dat 型のアドレスを返す
//
const Glib::ustring BBSListViewBase::row2url( const Gtk::TreeModel::Row& row )
Glib::ustring BBSListViewBase::row2url( const Gtk::TreeModel::Row& row )
{
if( ! row ) return Glib::ustring();

Expand Down Expand Up @@ -2135,7 +2135,7 @@ const Glib::ustring BBSListViewBase::row2url( const Gtk::TreeModel::Row& row )
//
// path -> name 変換
//
const Glib::ustring BBSListViewBase::path2name( const Gtk::TreePath& path )
Glib::ustring BBSListViewBase::path2name( const Gtk::TreePath& path )
{
Gtk::TreeModel::Row row = m_treeview.get_row( path );
if( !row ) return Glib::ustring();
Expand Down Expand Up @@ -2168,7 +2168,7 @@ int BBSListViewBase::row2type( const Gtk::TreeModel::Row& row )
//
// row -> name 変換
//
const Glib::ustring BBSListViewBase::row2name( const Gtk::TreeModel::Row& row )
Glib::ustring BBSListViewBase::row2name( const Gtk::TreeModel::Row& row )
{
if( !row ) return Glib::ustring();
return row[ m_columns.m_name ];
Expand Down Expand Up @@ -3033,7 +3033,7 @@ void BBSListViewBase::get_threads( const size_t dirid, std::vector< std::string


// 指定したidのディレクトリの名前を取得
const std::string BBSListViewBase::get_dirname( const int dirid )
std::string BBSListViewBase::get_dirname( const int dirid )
{
if( ! dirid ) return get_label();

Expand Down
16 changes: 8 additions & 8 deletions src/bbslist/bbslistviewbase.h
Expand Up @@ -103,7 +103,7 @@ namespace BBSLIST

Glib::RefPtr< Gtk::TreeStore >& get_treestore() { return m_treestore; }
SKELETON::EditTreeView& get_treeview() { return m_treeview; }
const bool& get_ready_tree() const{ return m_ready_tree; }
bool get_ready_tree() const { return m_ready_tree; }
void set_open_only_onedir( const bool set ){ m_open_only_onedir = set; }

void activate_act_before_popupmenu( const std::string& url ) override;
Expand Down Expand Up @@ -141,22 +141,22 @@ namespace BBSLIST
int row2type( const Gtk::TreeModel::Row& row );

// row -> name 変換
const Glib::ustring row2name( const Gtk::TreeModel::Row& row );
Glib::ustring row2name( const Gtk::TreeModel::Row& row );

// row -> url 変換
// 板の場合は boardbase
// スレの場合は dat 型のアドレスを返す
const Glib::ustring row2url( const Gtk::TreeModel::Row& row );
Glib::ustring row2url( const Gtk::TreeModel::Row& row );

// row -> dirid 変換
size_t row2dirid( const Gtk::TreeModel::Row& row );

// path からその行の名前を取得
const Glib::ustring path2name( const Gtk::TreePath& path );
Glib::ustring path2name( const Gtk::TreePath& path );

// path からその行のURLを取得
const Glib::ustring path2rawurl( const Gtk::TreePath& path );
const Glib::ustring path2url( const Gtk::TreePath& path ); // 移転をチェックするバージョン
Glib::ustring path2rawurl( const Gtk::TreePath& path );
Glib::ustring path2url( const Gtk::TreePath& path ); // 移転をチェックするバージョン

// url で指定した項目を削除
void remove_item( const std::string& url );
Expand Down Expand Up @@ -193,7 +193,7 @@ namespace BBSLIST
// 親ウィンドウをセット
void set_parent_win( Gtk::Window* parent_win ) override;

const std::string url_for_copy() override { return {}; }
std::string url_for_copy() override { return {}; }

bool set_command( const std::string& command,
const std::string& arg1 = {},
Expand Down Expand Up @@ -241,7 +241,7 @@ namespace BBSLIST
void get_threads( const size_t dirid, std::vector< std::string >& list_url );

// 指定したidのディレクトリの名前を取得
const std::string get_dirname( const int dirid );
std::string get_dirname( const int dirid );

// selectdialogで使う
Gtk::TreePath get_current_path() { return m_treeview.get_current_path(); }
Expand Down
4 changes: 2 additions & 2 deletions src/bbslist/selectdialog.cpp
Expand Up @@ -113,12 +113,12 @@ void SelectListDialog::slot_ok_clicked()
}


const std::string SelectListDialog::get_name()
std::string SelectListDialog::get_name()
{
return m_label_name.get_text();
}

const std::string SelectListDialog::get_path()
std::string SelectListDialog::get_path()
{
std::string path;
if( m_selectview ) path = m_selectview->get_current_path().to_string();
Expand Down
4 changes: 2 additions & 2 deletions src/bbslist/selectdialog.h
Expand Up @@ -36,8 +36,8 @@ namespace BBSLIST
SelectListDialog( Gtk::Window* parent, const std::string& url, Glib::RefPtr< Gtk::TreeStore >& treestore );
~SelectListDialog();

const std::string get_name();
const std::string get_path();
std::string get_name();
std::string get_path();

protected:

Expand Down
2 changes: 1 addition & 1 deletion src/board/boardadmin.cpp
Expand Up @@ -210,7 +210,7 @@ COMMAND_ARGS BoardAdmin::url_to_openarg( const std::string& url, const bool tab,
}


const std::string BoardAdmin::command_to_url( const COMMAND_ARGS& command )
std::string BoardAdmin::command_to_url( const COMMAND_ARGS& command )
{
if( command.arg4 == "NEXT" ) return command.url + NEXT_SIGN + ARTICLE_SIGN + command.arg5;

Expand Down
2 changes: 1 addition & 1 deletion src/board/boardadmin.h
Expand Up @@ -44,7 +44,7 @@ namespace BOARD

void restore( const bool only_locked ) override;
COMMAND_ARGS url_to_openarg( const std::string& url, const bool tab, const bool lock ) override;
const std::string command_to_url( const COMMAND_ARGS& command ) override;
std::string command_to_url( const COMMAND_ARGS& command ) override;

void switch_admin() override;

Expand Down