summaryrefslogtreecommitdiffabout
path: root/microkde
Side-by-side diff
Diffstat (limited to 'microkde') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kapplication.cpp3
-rw-r--r--microkde/kdecore/klibloader.cpp14
-rw-r--r--microkde/kdeui/ktoolbar.cpp2
-rw-r--r--microkde/kdeui/ktoolbar.h2
4 files changed, 7 insertions, 14 deletions
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index 21aa0a4..f05b91b 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -64,47 +64,48 @@ void KApplication::showFile(QString caption, QString fn)
text = ts.read();
file.close();
KApplication::showText( caption, text );
}
bool KApplication::convert2latin1(QString fileName)
{
QString text;
QFile file( fileName );
if (!file.open( IO_ReadOnly ) ) {
return false;
}
QTextStream ts( &file );
ts.setEncoding( QTextStream::UnicodeUTF8 );
text = ts.read();
file.close();
if (!file.open( IO_WriteOnly ) ) {
return false;
}
QTextStream tsIn( &file );
tsIn.setEncoding( QTextStream::Latin1 );
tsIn << text.latin1();
- file.close();
+ file.close();
+ return true;
}
void KApplication::showText(QString caption, QString text)
{
QDialog dia( 0, "name", true ); ;
dia.setCaption( caption );
QVBoxLayout* lay = new QVBoxLayout( &dia );
lay->setSpacing( 3 );
lay->setMargin( 3 );
KTextEdit tb ( &dia );
tb.setWordWrap( QMultiLineEdit::WidgetWidth );
lay->addWidget( &tb );
tb.setText( text );
#ifdef DESKTOP_VERSION
dia.resize( 640, 480);
#else
dia.showMaximized();
#endif
dia.exec();
}
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp
index 1394154..6d0475a 100644
--- a/microkde/kdecore/klibloader.cpp
+++ b/microkde/kdecore/klibloader.cpp
@@ -475,59 +475,51 @@ KLibrary* KLibLoader::library( const char *name )
wrap = it.current();
}
if (wrap) {
d->pending_close.removeRef(wrap);
if (!wrap->lib) {
/* This lib only was in loaded_stack, but not in m_libs. */
wrap->lib = new KLibrary( name, wrap->filename, wrap->handle );
}
wrap->ref_count++;
} else {
QString libfile = findLibrary( name );
if ( libfile.isEmpty() )
return 0;
#ifdef DESKTOP_VERSION
QLibrary *qlib = new QLibrary( libfile.latin1() );
#else
QLibrary *qlib = new QLibrary( libfile.latin1(), QLibrary::Immediately );
#endif
//US lt_dlhandle handle = lt_dlopen( libfile.latin1() );
//US if ( !handle )
if ( !qlib )
{
-//US const char* errmsg = lt_dlerror();
- char* errmsg;
- sprintf(errmsg, "KLibLoader::library could not load library: %s", libfile.latin1());
- qDebug(errmsg);
-
- if(errmsg)
- d->errorMessage = QString::fromLatin1(errmsg);
- else
- d->errorMessage = QString::null;
- kdWarning(150) << "library=" << name << ": file=" << libfile << ": " << d->errorMessage << endl;
- return 0;
+ qDebug( "KLibLoader::library could not load library: %s", libfile.latin1());
+ d->errorMessage = QString::null;
+ return 0;
}
else
d->errorMessage = QString::null;
KLibrary *lib = new KLibrary( name, libfile, qlib );
wrap = new KLibWrapPrivate(lib, qlib);
d->loaded_stack.prepend(wrap);
}
m_libs.insert( name, wrap );
connect( wrap->lib, SIGNAL( destroyed() ),
this, SLOT( slotLibraryDestroyed() ) );
return wrap->lib;
}
QString KLibLoader::lastErrorMessage() const
{
return d->errorMessage;
}
void KLibLoader::unloadLibrary( const char *libname )
{
KLibWrapPrivate *wrap = m_libs[ libname ];
diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp
index 1ad1728..09ad0c8 100644
--- a/microkde/kdeui/ktoolbar.cpp
+++ b/microkde/kdeui/ktoolbar.cpp
@@ -857,49 +857,49 @@ void KToolBar::setFullSize(bool flag )
bool KToolBar::fullSize() const
{
return isHorizontalStretchable() || isVerticalStretchable();
}
void KToolBar::enableMoving(bool flag )
{
//US setMovingEnabled(flag);
this->mainWindow()->setToolBarsMovable(flag);
}
void KToolBar::setBarPos (BarPosition bpos)
{
if ( !mainWindow() )
return;
//US mainWindow()->moveDockWindow( this, (Dock)bpos );
mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos );
}
-KToolBar::BarPosition KToolBar::barPos()
+KToolBar::BarPosition KToolBar::barPos() const
{
if ( !(QMainWindow*)mainWindow() )
return KToolBar::Top;
//US Dock dock;
QMainWindow::ToolBarDock dock;
int dm1, dm2;
bool dm3;
((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 );
//US if ( dock == DockUnmanaged ) {
if ( dock == QMainWindow::Unmanaged ) {
return (KToolBar::BarPosition)Top;
}
return (BarPosition)dock;
}
bool KToolBar::enable(BarStatus stat)
{
bool mystat = isVisible();
if ( (stat == Toggle && mystat) || stat == Hide )
hide();
else
show();
diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h
index 61b5ea3..49ff856 100644
--- a/microkde/kdeui/ktoolbar.h
+++ b/microkde/kdeui/ktoolbar.h
@@ -725,49 +725,49 @@ public:
*/
void setFullSize(bool flag = true);
/**
* @return @p true if the full-size mode is enabled. Otherwise
* it returns @false.
*/
bool fullSize() const;
/**
* @deprecated use setMovingEnabled(bool) instead.
* Enable or disable moving of toolbar.
*/
void enableMoving(bool flag = true);
/**
* Set position of toolbar.
* @see BarPosition()
*/
void setBarPos (BarPosition bpos);
/**
* Returns position of toolbar.
*/
- BarPosition barPos();
+ BarPosition barPos() const;
/**
* @deprecated
* Show, hide, or toggle toolbar.
*
* This method is provided for compatibility only,
* please use show() and/or hide() instead.
* @see BarStatus
*/
bool enable(BarStatus stat);
/**
* @deprecated
* Use setMaximumHeight() instead.
*/
void setMaxHeight (int h); // Set max height for vertical toolbars
/**
* @deprecated
* Use maximumHeight() instead.
* Returns the value that was set with @ref setMaxHeight().
*/
int maxHeight();