Permalink
Browse files

minor update

  • Loading branch information...
1 parent b31a477 commit ae511b489cda013cbb7e4a93396e7f558036a9df @beimprovised committed Jan 8, 2017
@@ -407,7 +407,7 @@ void sapp_t::sys_init(char * *argv){
#if QT_VERSION < 0x050000
// Установка кодека текстов
- QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF - 8"));
+ QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
#endif
// // Инициализация глобальных параметров,
Oops, something went wrong.
@@ -85,20 +85,13 @@ struct TreeIndex : public boost::intrusive_ref_counter<TreeIndex, boost::thread_
protected:
private:
-// TreeIndex(const std::function<km_t *()> &current_model, boost::intrusive_ptr<TreeItem> host_parent_, int sibling_order = 0); // , const QModelIndex &_current_index
+
TreeIndex(const std::function<tkm_t *()> &current_model_, boost::intrusive_ptr<TreeItem> host_, const index_tree &host_index_, const int sibling_order_);
-// static boost::intrusive_ptr<TreeItem> item_register(const QUrl &find_url_
-// , const insert_strategy &tree_view_insert_strategy_
-// , equal_url equal_ // = [](boost::intrusive_ptr<const TreeItem> it, const QUrl &_url)->bool {return it->field("url") == _url.toString();}
-// );
- // boost::intrusive_ptr<TreeItem> item_register(boost::intrusive_ptr<TreeItem> target
- // , const KnowView::paste_strategy &_view_paste_strategy
- // , equal_t _equal // = [](boost::intrusive_ptr<const TreeItem> it, boost::intrusive_ptr<const TreeItem> target)->bool {return it->id() == target->id();}
- // );
+
std::function<tkm_t *()> _current_model;
boost::intrusive_ptr<TreeItem> _host;
-// boost::intrusive_ptr<TreeItem> _host_parent;
+// boost::intrusive_ptr<TreeItem> _host_parent;
int _sibling_order;
// index_tree _host_parent_index;
@@ -2365,319 +2365,7 @@ namespace browser {
}
}
-// boost::intrusive_ptr<TreeItem> TabWidget::item_request_from_tree_impl(const QUrl &_url)
-// {
-// TreeScreen *_tree_screen = _tree_screen;
-//// auto _know_model_root = tree_screen->know_root();
-// auto _know_model_board = _tree_screen->know_model_board();
-// auto _current_view_model = _tree_screen->tree_view()->source_model();
-
-// boost::intrusive_ptr<TreeItem> _result(nullptr); // = _know_model_board->root_item();
-//// boost::intrusive_ptr<TreeItem> _source_root_item = tree_screen->know_branch()->item(TreeModel::delegater(_url)); // on know_root semantic
-// boost::intrusive_ptr<TreeItem> _source_item = _know_model_board->item_by_url(_url);
-
-//// if(_source_root_item && !_source_item) {
-//// auto result = tree_screen->cut_from_root(_source_root_item);
-
-//// if(result)_source_item = tree_screen->paste_to_branch(result, _know_model_branch);
-
-//// assert(result);
-//// assert(_source_item);
-//// assert((_source_item == result) && (result == _source_root_item));
-//// }
-
-// bool item_is_brand_new = false;
-//// // if(_record_controller) {
-//// auto browser_pages = this->_source_model->browser_pages();
-//// assert(browser_pages);
-
-//// if(browser_pages) {
-// auto v = find(_url);
-
-// if(v) {
-// _result = v->page()->record_binder()->bounded_item();
-// assert(_result->url() == _url);
-// }
-
-// if(_source_item && _source_item != _know_model_board->root_item()) {
-// if(!_result) {
-
-// if(_source_item->is_lite())_source_item->to_fat();
-
-//// // _source_item->binder(generator);
-//// // _source_item->activator(activator);
-
-//// // _item = register_item_to_browser_source_model(_source_item);
-
-//// _source_item->is_registered_to_record_controller_and_tabmanager(false);
-//// // _source_item->self_bind();
-// _result = _source_item;
-// } else {
-// assert(_result->url() == _url);
-//// assert(_result->fragment() == _source_item->fragment());
-
-// if(_result != _source_item) {
-// _result = _source_item; // assert(_item.get() == _source_item.get());
-//// _result = const_cast<KnowModel *>(_know_model_board)->duplicated_remove(_result, _source_item);
-// }
-
-// if(_result->is_lite())_result->to_fat();
-
-// if(_result->field("id") == "")_result->field("id", get_unical_id());
-
-// assert(_result->is_registered_to_browser() || _result->field("url") == browser::Browser::_defaulthome);
-
-//// // _result->binder(generator);
-//// // _result->activator(activator);
-
-//// _result->is_registered_to_record_controller_and_tabmanager(false);
-//// // _item->self_bind();
-// }
-
-// assert(!_result->is_lite());
-//// assert(_result->is_registered_to_record_controller_and_tabmanager());
-
-// } else {
-// item_is_brand_new = true;
-
-// if(!_result) {
-
-//// int pos = _record_ontroller->getFirstSelectionPos();
-//// Record *previous_record = _record_ontroller->getRecordTableModel()->getRecordTableData()->getRecord(pos);
-
-//// if(previous_record) {
-
-//// Record record;
-
-//// if(record.isLite())record.switchToFat();
-
-//// //QString title = d->view->title(); // not ready yet
-//// //record.setNaturalFieldSource("id", previous_record->getNaturalFieldSource("id")); // id concept?
-//// record.setNaturalFieldSource("pin", "");
-//// record.setNaturalFieldSource("name", previous_record->getNaturalFieldSource("name"));
-//// record.setNaturalFieldSource("author", previous_record->getNaturalFieldSource("author"));
-//// record.setNaturalFieldSource("url", _url.toString()); // only changed
-//// record.setNaturalFieldSource("tags", previous_record->getNaturalFieldSource("tags"));
-
-//// _record_ontroller->addNew(ADD_NEW_RECORD_AFTER, record); //recordTableController->autoAddNewAfterContext();
-//// _record = recordtabledata->getRecordByUrl(_url);
-//// // int pos = _record_ontroller->getFirstSelectionPos();
-//// // _record = _record_ontroller->getRecordTableModel()->getRecordTableData()->getRecord(pos);
-//// } else {
-
-
-
-
-//// record.generator(generator);
-
-
-//// Имя директории, в которой расположены файлы картинок, используемые в тексте и приаттаченные файлы
-// QString directory = DiskHelper::create_temp_directory(); //
-
-// QMap<QString, QString> data;
-// data["id"] = get_unical_id();
-// data["pin"] = _string_from_check_state[Qt::Unchecked];
-// data["name"] = "";
-// data["author"] = "";
-// data["home"] = _url.toString();
-// data["url"] = _url.toString();
-// data["tags"] = "";
-// data["dir"] = data["id"];
-// data["file"] = "text.html";
-
-// boost::intrusive_ptr<TreeItem> item
-// = boost::intrusive_ptr<TreeItem>(new TreeItem(nullptr, data));
-
-//// if(record.isLite())
-// item->to_fat();
-// item->text_to_fat("");
-//// // QString title = _url.toString(); // not ready yet
-//// item->field("id", get_unical_id());
-//// item->field("pin", _check_state[Qt::Unchecked]);
-//// item->field("name", "");
-//// item->field("author", "");
-//// item->field("home", _url.toString()); // only changed
-//// item->field("url", _url.toString()); // only changed
-//// item->field("tags", "");
-
-//// // _record_ontroller->addNew(ADD_NEW_RECORD_AFTER, record); //recordTableController->autoAddNewAfterContext();
-//// // _record = recordtabledata->getRecordByUrl(_url);
-//// // // int pos = _record_ontroller->getFirstSelectionPos();
-//// // // _record = _record_ontroller->getRecordTableModel()->getRecordTableData()->getRecord(pos);
-
-//// // // }
-
-//// // record->binder(generator);
-//// // record->activator(activator);
-
-// item->picture_files(DiskHelper::get_files_from_directory(directory, "*.png"));
-
-
-//// Пока что принята концепция, что файлы нельзя приаттачить в момент создания записи
-//// Запись должна быть создана, потом можно аттачить файлы.
-//// Это ограничение для "ленивого" программинга, но пока так
-//// record->setAttachFiles( DiskHelper::getFilesFromDirectory(directory, "*.bin") );
-
-//// Временная директория с картинками и приаттаченными файлами удаляется
-// DiskHelper::remove_directory(directory);
-// if(item->is_lite())item->to_fat();
-
-//// // item->binder(generator);
-//// // item->activator(activator);
-
-//// // _item = register_item_to_browser_source_model(item);
-//// item->is_registered_to_record_controller_and_tabmanager(true);
-//// // item->self_bind();
-//// // assert(_record);
-//// // assert(_record->is_registered());
-//// // _record->active_immediately(active_immediately);
-//// // _record->generator(generator);
-
-
-// _result = item; // assert(_item.get() == item.get());
-// } else {
-// assert(_result->url() == _url);
-
-// if(_result->is_lite())_result->to_fat();
-
-// if(_result->field("id") == "")_result->field("id", get_unical_id());
-
-// assert(_result->is_registered_to_browser() || _result->field("url") == browser::Browser::_defaulthome);
-
-//// // _result->binder(generator);
-//// // _result->activator(activator);
-
-//// _result->is_registered_to_record_controller_and_tabmanager(true);
-//// // _item->self_bind();
-// }
-
-// {
-// auto _view_index = _tree_screen->tree_view()->index_current();
-
-//// if(idx.isValid()) {
-
-// auto it = _current_view_model->item(_view_index); //item_from_id(static_cast<TreeItem *>(_view_index.internalPointer())->id());
-// assert(it);
-// assert(_current_view_model->is_id_exists(it->id()));
-
-//// if(_item->is_lite())_item->to_fat();
-
-// if(it != _result && item_is_brand_new) {
-// assert(_result->url() == _url);
-//// assert(_result->fragment() == _url.fragment());
-//// int pos
-// _result = _tree_screen->branch_add(_view_index, _result, true, _current_view_model); // it->insert_new_item(it->current_count() - 1, _result);
-// assert(_result);
-// _tree_screen->synchronized(false);
-//// assert(_result == it->child(pos));
-// }
-
-// _tree_screen->knowtree_save();
-//// }
-// }
-// }
-
-// if(_result->is_lite())_result->to_fat();
-
-//// // // else {
-//// // // // assert(_record->is_registered());
-//// // // _record->binder(generator);
-//// // // _record->activator(activator);
-//// // // // _record->generate(); // why?
-//// // // }
-
-//// _result->record_binder(_record_binder);
-//// // _result->activator(activator);
-
-// assert(_result != _know_model_board->root_item());
-//// // assert(_result->is_registered_to_record_controller_and_tabmanager());
-//// assert(_result->field("url") == _url.toString()); // maybe other url loaded !
-//// // } // browser_pages
-
-//// // }
-
-//// // }
-
-// if(_result->field("dir") == "")_result->field("dir", _result->field("id"));
-
-// if(_result->field("file") == "")_result->field("file", "text.html");
-
-//// // assert(_record);
-// assert(_result->url() == _url);
-//// assert(_result->fragment() == _url.fragment());
-// return _result;
-// }
-
-
-// boost::intrusive_ptr<TreeItem> TabWidget::item_request_from_tree_fragment(const QUrl &_url)
-// {
-// boost::intrusive_ptr<TreeItem> re;
-// auto it = item_request_from_tree_impl<url_fragment>(_url);
-
-// re = item_registered_resetup_record_binder(it);
-
-// return re;
-// }
-
-// boost::intrusive_ptr<TreeItem> TabWidget::item_request_from_tree(const QUrl &_url)
-// {
-// boost::intrusive_ptr<TreeItem> re;
-// auto it = item_request_from_tree_impl<url_full>(_url);
-
-// re = item_registered_resetup_record_binder(it);
-
-// return re;
-//// auto ar = boost::make_shared<TabWidget::Coupler>(this, true);
-
-//// // bind_helper binder = std::make_shared<sd::_interface<sd::meta_info<boost::shared_ptr<void>>, browser::WebView *, boost::intrusive_ptr<TreeItem> // , boost::intrusive_ptr<TreeItem>(TreeItem::*)(WebPage *)
-//// // >>("", &TabWidget::RecordBinder::binder, ar);
-//// // active_helper activator = std::make_shared<sd::_interface<sd::meta_info<boost::shared_ptr<void>>, browser::WebView *>>("", &TabWidget::RecordBinder::activator, ar);
-
-//// return _record_controller->item_request_from_tree(_url
-//// , std::make_shared<CouplerDelegation>(
-//// std::make_shared<bounded_item_interface>("", &Coupler::bounded_item, ar)
-//// , std::make_shared<bounded_page_interface>("", &Coupler::bounded_page, ar)
-//// , std::make_shared<bind_interface>("", &Coupler::binder, ar)
-//// , std::make_shared<activate_interface> ("", &Coupler::activator, ar)
-//// ));
-// }
-
-// boost::intrusive_ptr<TreeItem> TabWidget::item_bind(boost::intrusive_ptr<TreeItem> item)
-// {
-//// auto binder = [](boost::shared_ptr<TabWidget::RecordBinder> ar) {
-//// return std::make_shared<sd::_interface<sd::meta_info<boost::shared_ptr<void>>, browser::WebView *, boost::intrusive_ptr<TreeItem> // , boost::intrusive_ptr<TreeItem>(TreeItem::*)(WebPage *)
-//// >> ("", &TabWidget::RecordBinder::binder, ar);
-//// };
-//// auto activator = [](boost::shared_ptr<TabWidget::RecordBinder> ar) {
-//// return std::make_shared<sd::_interface<sd::meta_info<boost::shared_ptr<void>>, browser::WebView *>> ("", &TabWidget::RecordBinder::activator, ar);
-//// };
-
-//// registered record, but have no generator:
-//// boost::shared_ptr<TabWidget::Coupler> ar =
-
-
-// item->binder(std::make_shared<TreeItem::coupler>(std::make_shared<TabWidget::coupler>(this, item)));
-
-//// std::make_shared<TabWidget::Coupler>(this, item);
-
-//// // record->binder(
-//// // binder(ar)
-//// // );
-
-//// // record->activator(
-//// // activator(ar)
-//// // );
-
-//// item->record_binder(std::make_shared<CouplerDelegation>(
-//// std::make_shared<bounded_item_interface>("", &Coupler::bounded_item, ar)
-//// , std::make_shared<bounded_page_interface>("", &Coupler::bounded_page, ar)
-//// , std::make_shared<bind_interface>("", &Coupler::binder, ar)
-//// , std::make_shared<activate_interface> ("", &Coupler::activator, ar)
-//// ));
-// assert(item->binder());
-// return item;
-// }
#if QT_VERSION == 0x050600
W_OBJECT_IMPL(WebActionMapper)
Oops, something went wrong.

0 comments on commit ae511b4

Please sign in to comment.