From ad6f3f6402df4bdf88672d511e21ab1e9b88d978 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 7 Dec 2020 22:58:44 +0900 Subject: Renaming of files in preparation for code style tools. Signed-off-by: Michele Calgaro (cherry picked from commit 145abc15d57fb29701a12e8a14dcb9c1fd72e9be) --- konqueror/preloader/CMakeLists.txt | 2 +- konqueror/preloader/Makefile.am | 2 +- konqueror/preloader/configure.in.in | 2 +- konqueror/preloader/preloader.cc | 151 ------------------------------------ konqueror/preloader/preloader.cpp | 151 ++++++++++++++++++++++++++++++++++++ 5 files changed, 154 insertions(+), 154 deletions(-) delete mode 100644 konqueror/preloader/preloader.cc create mode 100644 konqueror/preloader/preloader.cpp (limited to 'konqueror/preloader') diff --git a/konqueror/preloader/CMakeLists.txt b/konqueror/preloader/CMakeLists.txt index 90e72194b..f5610a0ae 100644 --- a/konqueror/preloader/CMakeLists.txt +++ b/konqueror/preloader/CMakeLists.txt @@ -42,7 +42,7 @@ tde_create_translated_desktop( set( target kded_konqy_preloader ) set( ${target}_SRCS - preloader.cc preloader.skel + preloader.cpp preloader.skel ) tde_add_kpart( ${target} AUTOMOC diff --git a/konqueror/preloader/Makefile.am b/konqueror/preloader/Makefile.am index efe0413bd..6b27b7fef 100644 --- a/konqueror/preloader/Makefile.am +++ b/konqueror/preloader/Makefile.am @@ -3,7 +3,7 @@ AM_CPPFLAGS = -DQT_NO_CAST_ASCII kde_module_LTLIBRARIES = kded_konqy_preloader.la INCLUDES= -I.. $(all_includes) -kded_konqy_preloader_la_SOURCES = preloader.cc preloader.skel +kded_konqy_preloader_la_SOURCES = preloader.cpp preloader.skel kded_konqy_preloader_la_LDFLAGS = $(all_libraries) -module -avoid-version kded_konqy_preloader_la_LIBADD = ../libkonqueror_intern.la $(LIB_TDESYCOCA) $(LIB_TDECORE) diff --git a/konqueror/preloader/configure.in.in b/konqueror/preloader/configure.in.in index 315b23c97..a581917cb 100644 --- a/konqueror/preloader/configure.in.in +++ b/konqueror/preloader/configure.in.in @@ -1,5 +1,5 @@ dnl check whether mallinfo() is available and which fields to use to find out memory usage -dnl it's used in konq_mainwindow.cc +dnl it's used in konq_mainwindow.cpp dnl warning, ugly code ahead dnl some implementations have mallinfo() in stdlib.h, others in malloc.h dnl fields showing memory usage should be hblkhd, uordblks and usmblks, diff --git a/konqueror/preloader/preloader.cc b/konqueror/preloader/preloader.cc deleted file mode 100644 index 5d87a8b07..000000000 --- a/konqueror/preloader/preloader.cc +++ /dev/null @@ -1,151 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Lubos Lunak - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "preloader.h" -#include "konq_settingsxt.h" - -#include -#include -#include -#include -#include - -KonqyPreloader::KonqyPreloader( const TQCString& obj ) - : KDEDModule( obj ) - { - reconfigure(); - connect( kapp->dcopClient(), TQT_SIGNAL( applicationRemoved( const TQCString& )), - TQT_SLOT( appRemoved( const TQCString& ))); - connect( &check_always_preloaded_timer, TQT_SIGNAL( timeout()), - TQT_SLOT( checkAlwaysPreloaded())); - } - -KonqyPreloader::~KonqyPreloader() - { - updateCount(); - } - -bool KonqyPreloader::registerPreloadedKonqy( TQCString id, int screen ) - { - if( instances.count() >= (uint)KonqSettings::maxPreloadCount() ) - return false; - instances.append( KonqyData( id, screen )); - return true; - } - -TQCString KonqyPreloader::getPreloadedKonqy( int screen ) - { - if( instances.count() == 0 ) - return ""; - for( InstancesList::Iterator it = instances.begin(); - it != instances.end(); - ++it ) - { - if( (*it).screen == screen ) - { - TQCString ret = (*it).id; - instances.remove( it ); - check_always_preloaded_timer.start( 5000, true ); - return ret; - } - } - return ""; - } - -void KonqyPreloader::unregisterPreloadedKonqy( TQCString id_P ) - { - for( InstancesList::Iterator it = instances.begin(); - it != instances.end(); - ++it ) - if( (*it).id == id_P ) - { - instances.remove( it ); - return; - } - } - -void KonqyPreloader::appRemoved( const TQCString& id ) - { - unregisterPreloadedKonqy( id ); - } - -void KonqyPreloader::reconfigure() - { - KonqSettings::self()->readConfig(); - updateCount(); - // Ignore "PreloadOnStartup" here, it's used by the .desktop file - // in the autostart folder, which will do 'konqueror --preload' in autostart - // phase 2. This will also cause activation of this kded module. - } - -void KonqyPreloader::updateCount() - { - while( instances.count() > (uint)KonqSettings::maxPreloadCount() ) - { - KonqyData konqy = instances.first(); - instances.pop_front(); - DCOPRef ref( konqy.id, "KonquerorIface" ); - ref.send( "terminatePreloaded" ); - } - if( KonqSettings::alwaysHavePreloaded() && - KonqSettings::maxPreloadCount() > 0 && - instances.count() == 0 ) - { - if( !check_always_preloaded_timer.isActive()) - { - if( kapp->tdeinitExec( TQString::fromLatin1( "konqueror" ), - TQStringList() << TQString::fromLatin1( "--preload" ), NULL, NULL, "0" ) == 0 ) - { - kdDebug( 1202 ) << "Preloading Konqueror instance" << endl; - check_always_preloaded_timer.start( 5000, true ); - } - // else do nothing, the launching failed - } - } - } - -// have 5s interval between attempts to preload a new konqy -// in order not to start many of them at the same time -void KonqyPreloader::checkAlwaysPreloaded() - { - // TODO here should be detection whether the system is too busy, - // and delaying preloading another konqy in such case - // but I have no idea how to do it - updateCount(); - } - -void KonqyPreloader::unloadAllPreloaded() - { - while( instances.count() > 0 ) - { - KonqyData konqy = instances.first(); - instances.pop_front(); - DCOPRef ref( konqy.id, "KonquerorIface" ); - ref.send( "terminatePreloaded" ); - } - // ignore 'always_have_preloaded' here - } - -extern "C" -KDE_EXPORT KDEDModule *create_konqy_preloader( const TQCString& obj ) - { - return new KonqyPreloader( obj ); - } - -#include "preloader.moc" diff --git a/konqueror/preloader/preloader.cpp b/konqueror/preloader/preloader.cpp new file mode 100644 index 000000000..5d87a8b07 --- /dev/null +++ b/konqueror/preloader/preloader.cpp @@ -0,0 +1,151 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Lubos Lunak + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "preloader.h" +#include "konq_settingsxt.h" + +#include +#include +#include +#include +#include + +KonqyPreloader::KonqyPreloader( const TQCString& obj ) + : KDEDModule( obj ) + { + reconfigure(); + connect( kapp->dcopClient(), TQT_SIGNAL( applicationRemoved( const TQCString& )), + TQT_SLOT( appRemoved( const TQCString& ))); + connect( &check_always_preloaded_timer, TQT_SIGNAL( timeout()), + TQT_SLOT( checkAlwaysPreloaded())); + } + +KonqyPreloader::~KonqyPreloader() + { + updateCount(); + } + +bool KonqyPreloader::registerPreloadedKonqy( TQCString id, int screen ) + { + if( instances.count() >= (uint)KonqSettings::maxPreloadCount() ) + return false; + instances.append( KonqyData( id, screen )); + return true; + } + +TQCString KonqyPreloader::getPreloadedKonqy( int screen ) + { + if( instances.count() == 0 ) + return ""; + for( InstancesList::Iterator it = instances.begin(); + it != instances.end(); + ++it ) + { + if( (*it).screen == screen ) + { + TQCString ret = (*it).id; + instances.remove( it ); + check_always_preloaded_timer.start( 5000, true ); + return ret; + } + } + return ""; + } + +void KonqyPreloader::unregisterPreloadedKonqy( TQCString id_P ) + { + for( InstancesList::Iterator it = instances.begin(); + it != instances.end(); + ++it ) + if( (*it).id == id_P ) + { + instances.remove( it ); + return; + } + } + +void KonqyPreloader::appRemoved( const TQCString& id ) + { + unregisterPreloadedKonqy( id ); + } + +void KonqyPreloader::reconfigure() + { + KonqSettings::self()->readConfig(); + updateCount(); + // Ignore "PreloadOnStartup" here, it's used by the .desktop file + // in the autostart folder, which will do 'konqueror --preload' in autostart + // phase 2. This will also cause activation of this kded module. + } + +void KonqyPreloader::updateCount() + { + while( instances.count() > (uint)KonqSettings::maxPreloadCount() ) + { + KonqyData konqy = instances.first(); + instances.pop_front(); + DCOPRef ref( konqy.id, "KonquerorIface" ); + ref.send( "terminatePreloaded" ); + } + if( KonqSettings::alwaysHavePreloaded() && + KonqSettings::maxPreloadCount() > 0 && + instances.count() == 0 ) + { + if( !check_always_preloaded_timer.isActive()) + { + if( kapp->tdeinitExec( TQString::fromLatin1( "konqueror" ), + TQStringList() << TQString::fromLatin1( "--preload" ), NULL, NULL, "0" ) == 0 ) + { + kdDebug( 1202 ) << "Preloading Konqueror instance" << endl; + check_always_preloaded_timer.start( 5000, true ); + } + // else do nothing, the launching failed + } + } + } + +// have 5s interval between attempts to preload a new konqy +// in order not to start many of them at the same time +void KonqyPreloader::checkAlwaysPreloaded() + { + // TODO here should be detection whether the system is too busy, + // and delaying preloading another konqy in such case + // but I have no idea how to do it + updateCount(); + } + +void KonqyPreloader::unloadAllPreloaded() + { + while( instances.count() > 0 ) + { + KonqyData konqy = instances.first(); + instances.pop_front(); + DCOPRef ref( konqy.id, "KonquerorIface" ); + ref.send( "terminatePreloaded" ); + } + // ignore 'always_have_preloaded' here + } + +extern "C" +KDE_EXPORT KDEDModule *create_konqy_preloader( const TQCString& obj ) + { + return new KonqyPreloader( obj ); + } + +#include "preloader.moc" -- cgit v1.2.1