Changeset View
Changeset View
Standalone View
Standalone View
src/kedittoolbar.cpp
Show First 20 Lines • Show All 964 Lines • ▼ Show 20 Line(s) | 963 | while (clientIterator.hasPrevious()) { | |||
---|---|---|---|---|---|
965 | //qDebug(240) << "factory->removeClient " << client; | 965 | //qDebug(240) << "factory->removeClient " << client; | ||
966 | d->m_factory->removeClient(client); | 966 | d->m_factory->removeClient(client); | ||
967 | } | 967 | } | ||
968 | 968 | | |||
969 | KXMLGUIClient *firstClient = clients.first(); | 969 | KXMLGUIClient *firstClient = clients.first(); | ||
970 | 970 | | |||
971 | // now, rebuild the gui from the first to the last | 971 | // now, rebuild the gui from the first to the last | ||
972 | //qDebug(240) << "rebuilding the gui"; | 972 | //qDebug(240) << "rebuilding the gui"; | ||
973 | foreach (KXMLGUIClient *client, clients) { | 973 | for (KXMLGUIClient *client : clients) { | ||
974 | //qDebug(240) << "updating client " << client << " " << client->componentName() << " xmlFile=" << client->xmlFile(); | 974 | //qDebug(240) << "updating client " << client << " " << client->componentName() << " xmlFile=" << client->xmlFile(); | ||
975 | QString file(client->xmlFile()); // before setting ui_standards! | 975 | QString file(client->xmlFile()); // before setting ui_standards! | ||
976 | if (!file.isEmpty()) { | 976 | if (!file.isEmpty()) { | ||
977 | // passing an empty stream forces the clients to reread the XML | 977 | // passing an empty stream forces the clients to reread the XML | ||
978 | client->setXMLGUIBuildDocument(QDomDocument()); | 978 | client->setXMLGUIBuildDocument(QDomDocument()); | ||
979 | 979 | | |||
980 | // for the shell, merge in ui_standards.rc | 980 | // for the shell, merge in ui_standards.rc | ||
981 | if (client == firstClient) { // same assumption as in the ctor: first==shell | 981 | if (client == firstClient) { // same assumption as in the ctor: first==shell | ||
982 | client->loadStandardsXmlFile(); | 982 | client->loadStandardsXmlFile(); | ||
983 | } | 983 | } | ||
984 | 984 | | |||
985 | // and this forces it to use the *new* XML file | 985 | // and this forces it to use the *new* XML file | ||
986 | client->setXMLFile(file, client == firstClient /* merge if shell */); | 986 | client->setXMLFile(file, client == firstClient /* merge if shell */); | ||
987 | 987 | | |||
988 | // [we can't use reloadXML, it doesn't load ui_standards.rc] | 988 | // [we can't use reloadXML, it doesn't load ui_standards.rc] | ||
989 | } | 989 | } | ||
990 | } | 990 | } | ||
991 | 991 | | |||
992 | // Now we can add the clients to the factory | 992 | // Now we can add the clients to the factory | ||
993 | // We don't do it in the loop above because adding a part automatically | 993 | // We don't do it in the loop above because adding a part automatically | ||
994 | // adds its plugins, so we must make sure the plugins were updated first. | 994 | // adds its plugins, so we must make sure the plugins were updated first. | ||
995 | foreach (KXMLGUIClient *client, clients) { | 995 | for (KXMLGUIClient *client : clients) { | ||
996 | d->m_factory->addClient(client); | 996 | d->m_factory->addClient(client); | ||
997 | } | 997 | } | ||
998 | } | 998 | } | ||
999 | 999 | | |||
1000 | void KEditToolBarWidgetPrivate::setupLayout() | 1000 | void KEditToolBarWidgetPrivate::setupLayout() | ||
1001 | { | 1001 | { | ||
1002 | // the toolbar name combo | 1002 | // the toolbar name combo | ||
1003 | m_comboLabel = new QLabel(i18n("&Toolbar:"), m_widget); | 1003 | m_comboLabel = new QLabel(i18n("&Toolbar:"), m_widget); | ||
▲ Show 20 Lines • Show All 739 Lines • Show Last 20 Lines |