Index: gui/test/CMakeLists.txt
===================================================================
--- gui/test/CMakeLists.txt	(wersja 807254)
+++ gui/test/CMakeLists.txt	(kopia robocza)
@@ -15,7 +15,7 @@
 )
 
 kde4_add_unit_test( selectiontest  TESTNAME libokteta-gui-selectiontest  ${selectiontest_SRCS})
-target_link_libraries( selectiontest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( selectiontest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### next target ###############
@@ -25,7 +25,7 @@
 
 kde4_add_unit_test(coordtest TESTNAME libokteta-gui-coordtest  ${coordtest_SRCS})
 
-target_link_libraries(coordtest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY})
+target_link_libraries(coordtest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY})
 
 
 ########### next target ###############
@@ -34,7 +34,7 @@
 
 kde4_add_unit_test(coordrangetest TESTNAME libokteta-gui-coordrangetest  ${coordrangetest_SRCS})
 
-target_link_libraries(coordrangetest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY})
+target_link_libraries(coordrangetest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY})
 
 
 ########### next target ###############
@@ -46,7 +46,7 @@
 
 kde4_add_unit_test(coordrangelisttest TESTNAME libokteta-gui-coordrangelisttest  ${coordrangelisttest_SRCS})
 
-target_link_libraries(coordrangelisttest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY})
+target_link_libraries(coordrangelisttest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY})
 
 
 ########### next target ###############
Index: program/oktetakakao/controllers/CMakeLists.txt
===================================================================
--- program/oktetakakao/controllers/CMakeLists.txt	(wersja 807254)
+++ program/oktetakakao/controllers/CMakeLists.txt	(kopia robocza)
@@ -141,4 +141,4 @@
   ${VIEWCONFIGCONTROLLER_SRCS}
 )
 
-kde4_add_library( okteta_kakaocontrollers STATIC ${OKTETA_KAKAO_CONTROLLERS_SRCS} )
+#kde4_add_library( okteta_kakaocontrollers STATIC ${OKTETA_KAKAO_CONTROLLERS_SRCS} )
Index: program/oktetakakao/document/CMakeLists.txt
===================================================================
--- program/oktetakakao/document/CMakeLists.txt	(wersja 807254)
+++ program/oktetakakao/document/CMakeLists.txt	(kopia robocza)
@@ -13,4 +13,4 @@
   kbytearrayselection.cpp
 )
 
-kde4_add_library( okteta_kakaodocument STATIC ${OKTETA_KAKAO_DOCUMENT_SRCS} )
+kde4_add_library( okteta_kakaodocument ${OKTETA_KAKAO_DOCUMENT_SRCS} )
Index: program/libkakao/core/tests/testdocumentfilesynchronizerfactory.cpp
===================================================================
--- program/libkakao/core/tests/testdocumentfilesynchronizerfactory.cpp	(wersja 807254)
+++ program/libkakao/core/tests/testdocumentfilesynchronizerfactory.cpp	(kopia robocza)
@@ -25,6 +25,8 @@
 // lib
 #include "testdocument.h"
 #include "testdocumentfilesynchronizer.h"
+// KDE
+#include <KUrl>
 // Qt
 #include <QtCore/QLatin1String>
 
Index: program/CMakeLists.txt
===================================================================
--- program/CMakeLists.txt	(wersja 807254)
+++ program/CMakeLists.txt	(kopia robocza)
@@ -1,11 +1,14 @@
 project( oktetaprogram )
 
-add_subdirectory( libkakao )
-add_subdirectory( oktetakakao )
+#add_subdirectory( libkakao )
+#add_subdirectory( oktetakakao )
 
 include_directories(
 #TODO: remove this
   ../core
+  ../gui
+  ../gui/controller
+  ../gui/libcolumnsview
   libkakao/core/document
   libkakao/core/io
   libkakao/core/system
@@ -18,7 +21,10 @@
   oktetakakao/view
   oktetakakao/controllers/document
   oktetakakao/controllers/view
+  oktetakakao/controllers/view/libbytearrayfilter
+  oktetakakao/controllers/view/libbytearraylineedit
   oktetakakao/controllers/view/libfinddialog
+  oktetakakao/controllers/view/libframesprint
 )
 
 set( okteta_SRCS
@@ -26,23 +32,180 @@
   program.cpp
   about.cpp
   mainwindow.cpp
+
+  oktetakakao/controllers/document/overwriteonly/overwriteonlycontroller.cpp
+
+  oktetakakao/controllers/view/overwritemode/overwritemodecontroller.cpp
+
+  oktetakakao/controllers/view/info/statistictablemodel.cpp
+  oktetakakao/controllers/view/info/infotool.cpp
+  oktetakakao/controllers/view/info/infoview.cpp
+  oktetakakao/controllers/view/info/infocontroller.cpp
+
+  oktetakakao/controllers/view/stringsextract/stringsextracttool.cpp
+  oktetakakao/controllers/view/stringsextract/containedstringtablemodel.cpp
+  oktetakakao/controllers/view/stringsextract/stringsextractview.cpp
+  oktetakakao/controllers/view/stringsextract/stringsextractcontroller.cpp
+
+  oktetakakao/controllers/view/libbytearraylineedit/kbytearrayvalidator.cpp
+  oktetakakao/controllers/view/libbytearraylineedit/kbytearraylineedit.cpp
+
+  oktetakakao/controllers/view/libfinddialog/kabstractfinddialog.cpp
+
+  oktetakakao/controllers/view/poddecoder/poddata.cpp
+  oktetakakao/controllers/view/poddecoder/poddecodertool.cpp
+  oktetakakao/controllers/view/poddecoder/kprimitivetypesview.cpp
+  oktetakakao/controllers/view/poddecoder/poddecodercontroller.cpp
+
+  oktetakakao/controllers/view/bytetable/bytetablemodel.cpp
+  oktetakakao/controllers/view/bytetable/bytetabletool.cpp
+  oktetakakao/controllers/view/bytetable/bytetableview.cpp
+  oktetakakao/controllers/view/bytetable/bytetablecontroller.cpp
+
+  oktetakakao/controllers/view/search/ksearchdialog.cpp
+  oktetakakao/controllers/view/search/searchcontroller.cpp
+
+  oktetakakao/controllers/view/replace/kreplacedialog.cpp
+  oktetakakao/controllers/view/replace/kreplaceprompt.cpp
+  oktetakakao/controllers/view/replace/replacecontroller.cpp
+
+  oktetakakao/controllers/view/insertpattern/insertpatterntool.cpp
+  oktetakakao/controllers/view/insertpattern/insertpatterndialog.cpp
+  oktetakakao/controllers/view/insertpattern/insertpatterncontroller.cpp
+
+  oktetakakao/controllers/view/libbytearrayfilter/abstractbytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/abstractbytearrayfilterparameterset.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/abstractbytearrayfilterparametersetedit.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/nobytearrayfilterparameterset.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/operandbytearrayfilterparameterset.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/reversebytearrayfilterparameterset.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/rotatebytearrayfilterparameterset.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/andbytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/orbytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/xorbytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/invertbytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/reversebytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/rotatebytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/shiftbytearrayfilter.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/nobytearrayfilterparametersetedit.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/operandbytearrayfilterparametersetedit.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/reversebytearrayfilterparametersetedit.cpp
+  oktetakakao/controllers/view/libbytearrayfilter/filter/rotatebytearrayfilterparametersetedit.cpp
+
+  oktetakakao/controllers/view/filter/filtertool.cpp
+  oktetakakao/controllers/view/filter/filterview.cpp
+  oktetakakao/controllers/view/filter/filtercontroller.cpp
+
+  oktetakakao/controllers/view/gotooffset/kgotooffsetdialog.cpp
+  oktetakakao/controllers/view/gotooffset/gotooffsetcontroller.cpp
+
+  oktetakakao/controllers/view/bookmarks/bookmarkscontroller.cpp
+
+  oktetakakao/controllers/view/libframesprint/abstractframerenderer.cpp
+  oktetakakao/controllers/view/libframesprint/framestopaperprinter.cpp
+  oktetakakao/controllers/view/libframesprint/headerfooterframerenderer.cpp
+
+  oktetakakao/controllers/view/print/printcontroller.cpp
+  oktetakakao/controllers/view/print/printtool.cpp
+  oktetakakao/controllers/view/print/abstractcolumnrenderer.cpp
+  oktetakakao/controllers/view/print/abstractcolumnframerenderer.cpp
+  oktetakakao/controllers/view/print/offsetcolumnrenderer.cpp
+  oktetakakao/controllers/view/print/bordercolumnrenderer.cpp
+  oktetakakao/controllers/view/print/bytecolumnrenderer.cpp
+  oktetakakao/controllers/view/print/valuecolumnrenderer.cpp
+  oktetakakao/controllers/view/print/charcolumnrenderer.cpp
+  oktetakakao/controllers/view/print/bytearrayframerenderer.cpp
+
+  oktetakakao/controllers/view/viewconfig/viewconfigcontroller.cpp
+
+  oktetakakao/document/kbytearraydocumentfactory.cpp
+  oktetakakao/document/kbytearraydocument.cpp
+  oktetakakao/document/kbytearrayselection.cpp
+
+  oktetakakao/io/kabstractbytearraystreamencoder.cpp
+  oktetakakao/io/kbytearraysourcecodestreamencoder.cpp
+  oktetakakao/io/kbytearrayvaluestreamencoder.cpp
+  oktetakakao/io/kbytearraytextstreamencoder.cpp
+  oktetakakao/io/kbytearrayrawfilesynchronizer.cpp
+  oktetakakao/io/kbytearrayrawfilesynchronizerfactory.cpp
+
+  oktetakakao/view/kbytearraydisplayfactory.cpp
+  oktetakakao/view/kbytearraydisplay.cpp
+
+  libkakao/core/document/abstractmodel.cpp
+  libkakao/core/document/kabstractdocument.cpp
+  libkakao/core/document/kabstractdocumentselection.cpp
+  libkakao/core/document/kabstractdocumentfactory.cpp
+  libkakao/core/document/kdocumentversiondata.cpp
+  libkakao/core/io/kabstractdocumentstreamencoder.cpp
+  libkakao/core/io/kabstractdocumentsynchronizer.cpp
+  libkakao/core/io/kabstractdocumentsynchronizerfactory.cpp
+  libkakao/core/io/kabstractdocumentfilesystemsynchronizer.cpp
+  libkakao/core/system/kdocumentmanager.cpp
+  libkakao/core/system/kdocumentcreatemanager.cpp
+  libkakao/core/system/kdocumentsyncmanager.cpp
+  libkakao/core/system/kdocumentcodecmanager.cpp
+
+  libkakao/controllers/io/synchronize/synchronizecontroller.cpp
+
+  libkakao/controllers/io/setremote/setremotecontroller.cpp
+
+  libkakao/controllers/documentsystem/creator/creatorcontroller.cpp
+
+  libkakao/controllers/documentsystem/loader/loadercontroller.cpp
+
+  libkakao/controllers/documentsystem/close/closecontroller.cpp
+
+  libkakao/controllers/document/readonly/readonlycontroller.cpp
+
+  libkakao/controllers/document/versionview/versiontablemodel.cpp
+  libkakao/controllers/document/versionview/versionview.cpp
+  libkakao/controllers/document/versionview/versionviewcontroller.cpp
+
+  libkakao/controllers/view/version/versioncontroller.cpp
+
+  libkakao/controllers/view/zoom/zoomcontroller.cpp
+
+  libkakao/controllers/view/select/selectcontroller.cpp
+
+  libkakao/controllers/io/clipboard/clipboardcontroller.cpp
+
+  libkakao/controllers/io/copyas/copyascontroller.cpp
+
+  libkakao/controllers/shellwindow/viewlistmenu/viewlistmenucontroller.cpp
+
+  libkakao/controllers/shellwindow/fullscreen/fullscreencontroller.cpp
+
+  libkakao/controllers/program/quit/quitcontroller.cpp
+
+  libkakao/gui/view/kabstractview.cpp
+  libkakao/gui/system/dummyview.cpp
+  libkakao/gui/system/kviewmanager.cpp
+  libkakao/gui/system/abstractgroupedviews.cpp
+  libkakao/gui/system/tabbedviews.cpp
+  libkakao/gui/system/shellwindow.cpp
+  libkakao/gui/controller/kcontroller.cpp
 )
 
 kde4_add_executable( okteta  ${okteta_SRCS} )
 
 target_link_libraries( okteta
-  okteta_kakaocontrollers
-  okteta_kakaogui
-  okteta_kakaoio
-  okteta_kakaodocument
-  kakaocontrollers
-  kakaogui
-  kakaocore
+#  okteta_kakaocontrollers
+#  okteta_kakaogui
+#  okteta_kakaoio
+#  okteta_kakaodocument
+#  kakaocontrollers
+#  kakaogui
+#  kakaocore
   oktetagui
   oktetacore
   ${KDE4_KIO_LIBS}
 )
 
+if(KDE4_BUILD_TESTS)
+#  add_subdirectory(tests)
+endif(KDE4_BUILD_TESTS)
+
 install( TARGETS okteta  DESTINATION ${BIN_INSTALL_DIR} )
 
 
Index: core/ksectionlist.cpp
===================================================================
--- core/ksectionlist.cpp	(wersja 807254)
+++ core/ksectionlist.cpp	(kopia robocza)
@@ -22,7 +22,9 @@
 
 #include "ksectionlist.h"
 
+#include <QtAlgorithms> // needed for qFind (strange)
 
+
 namespace KHE
 {
 
@@ -36,9 +38,9 @@
 }
 
 
-void KSectionList::addSection( KSection NewSection )
+void KSectionList::addSection( const KSection& newSection )
 {
-  if( !NewSection.isValid() )
+  if( !newSection.isValid() )
     return;
 
   // we try to insert it by ascending indizes
@@ -47,33 +49,34 @@
   for( ; S!=end(); ++S )
   {
     // new section before next section?
-    if( NewSection.endsBefore((*S).beforeStart()) )
+    if( newSection.endsBefore((*S).beforeStart()) )
     {
       // put the new before it
-      insert( S, NewSection );
+      insert( S, newSection );
       return;
     }
 
     // does the next section overlap?
-    if( (*S).isJoinable(NewSection) )
+    if( (*S).isJoinable(newSection) )
     {
       // Start of the combined sections is the smaller one
-      NewSection.extendStartTo( (*S).start() );
+      KSection extendedSection( newSection );
+      extendedSection.extendStartTo( (*S).start() );
       // next we search all the overlapping sections and keep the highest end index
       int End = (*S).end();
       iterator LS = S;
       for( ++LS; LS!=end(); ++LS )
       {
-        if( NewSection.endsBefore((*LS).beforeStart()) )
+        if( extendedSection.endsBefore((*LS).beforeStart()) )
           break;
         End = (*LS).end();
       }
       // the higher end is the end of the combined section
-      NewSection.extendEndTo( End );
+      extendedSection.extendEndTo( End );
       // remove all overlapping sections
       S = erase( S, LS );
       // and instead insert the combined one
-      insert( S, NewSection );
+      insert( S, extendedSection );
       return;
     }
   }
@@ -81,7 +84,7 @@
   // all others before the new?
   if( S == end() )
     // add it at the end
-    append( NewSection );
+    append( newSection );
 }
 
 }
Index: core/tests/CMakeLists.txt
===================================================================
--- core/tests/CMakeLists.txt	(wersja 807254)
+++ core/tests/CMakeLists.txt	(kopia robocza)
@@ -9,7 +9,8 @@
   util/fill.cpp
 )
 
-kde4_add_library( oktetacoretestutil  STATIC ${oktetacoretestutil_LIB_SRCS} )
+kde4_add_library( oktetacoretestutil SHARED ${oktetacoretestutil_LIB_SRCS} )
+target_link_libraries( oktetacoretestutil oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### arraychangemetricstest ###############
@@ -20,18 +21,17 @@
 )
 
 kde4_add_unit_test( arraychangemetricstest  TESTNAME libokteta-core-arraychangemetricstest  ${arraychangemetricstest_SRCS} )
-target_link_libraries( arraychangemetricstest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( arraychangemetricstest oktetacore  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### ksectiontest ###############
 
 set( ksectiontest_SRCS
   ksectiontest.cpp
-  ${SUTDIR}/ksection.cpp
 )
 
 kde4_add_unit_test( ksectiontest  TESTNAME libokteta-core-ksectiontest  ${ksectiontest_SRCS} )
-target_link_libraries( ksectiontest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( ksectiontest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### ksectionlisttest ###############
@@ -41,7 +41,7 @@
 )
 
 kde4_add_unit_test( ksectionlisttest  TESTNAME libokteta-core-ksectionlisttest  ${ksectionlisttest_SRCS} )
-target_link_libraries( ksectionlisttest  testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( ksectionlisttest  oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### kfixedsizebytearraymodeltest ###############
@@ -52,7 +52,7 @@
 
 kde4_add_unit_test( kfixedsizebytearraymodeltest  TESTNAME libokteta-core-kfixedsizebytearraymodeltest  ${kfixedsizebytearraymodeltest_SRCS})
 target_link_libraries( kfixedsizebytearraymodeltest
-  testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -68,7 +68,7 @@
   ${kfixedsizebytearraymodelkabstractbytearraymodeliftest_SRCS}
 )
 target_link_libraries( kfixedsizebytearraymodelkabstractbytearraymodeliftest
-  oktetacoretestutil testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacoretestutil oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -80,7 +80,7 @@
 
 kde4_add_unit_test( kbytearraymodeltest  TESTNAME libokteta-core-kbytearraymodeltest  ${kbytearraymodeltest_SRCS} )
 target_link_libraries( kbytearraymodeltest
-  testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -96,7 +96,7 @@
   ${kbytearraymodelkabstractbytearraymodeliftest_SRCS}
 )
 target_link_libraries( kbytearraymodelkabstractbytearraymodeliftest
-  oktetacoretestutil testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacoretestutil oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -112,7 +112,7 @@
   ${kpiecetablebytearraymodelkabstractbytearraymodeliftest_SRCS}
 )
 target_link_libraries( kpiecetablebytearraymodelkabstractbytearraymodeliftest
-  oktetacoretestutil testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacoretestutil oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -128,7 +128,7 @@
   ${kpiecetablebytearraymodelversionableiftest_SRCS}
 )
 target_link_libraries( kpiecetablebytearraymodelversionableiftest
-  oktetacoretestutil testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacoretestutil oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -140,7 +140,7 @@
 
 kde4_add_unit_test( kcharcodectest  TESTNAME libokteta-core-kcharcodectest  ${kcharcodectest_SRCS})
 target_link_libraries( kcharcodectest
-  testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -148,11 +148,12 @@
 
 set( ktextcharcodectest_SRCS
   ktextcharcodectest.cpp
+  ${SUTDIR}/codecs/ktextcharcodec.cpp
 )
 
 kde4_add_unit_test( ktextcharcodectest  TESTNAME libokteta-core-ktextcharcodectest  ${ktextcharcodectest_SRCS} )
 target_link_libraries( ktextcharcodectest
-  testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -161,23 +162,24 @@
 set( ktextcharcodeckcharcodeciftest_SRCS
   kcharcodeciftest.cpp
   ktextcharcodeckcharcodeciftest.cpp
+  ${SUTDIR}/codecs/ktextcharcodec.cpp
 )
 
 kde4_add_unit_test( ktextcharcodeckcharcodeciftest TESTNAME libokteta-core-ktextcharcodeckcharcodeciftest  ${ktextcharcodeckcharcodeciftest_SRCS} )
 target_link_libraries( ktextcharcodeckcharcodeciftest
-  testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
 ########### kebcdic1047charcodeckcharcodeciftest ###############
 
 set( kebcdic1047charcodeckcharcodeciftest_SRCS
-  kcharcodeciftest.cpp kebcdic1047charcodeckcharcodeciftest.cpp
+  ${SUTDIR}/codecs/kebcdic1047charcodec.cpp kcharcodeciftest.cpp kebcdic1047charcodeckcharcodeciftest.cpp 
 )
 
 kde4_add_unit_test( kebcdic1047charcodeckcharcodeciftest  TESTNAME libokteta-core-kebcdic1047charcodeckcharcodeciftest  ${kebcdic1047charcodeckcharcodeciftest_SRCS} )
 target_link_libraries( kebcdic1047charcodeckcharcodeciftest
-  testoktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
+  oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY}
 )
 
 
@@ -188,17 +190,16 @@
 )
 
 kde4_add_unit_test( kbookmarktest  TESTNAME libokteta-core-kbookmarktest  ${kbookmarktest_SRCS} )
-target_link_libraries( kbookmarktest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( kbookmarktest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### kbookmarklisttest ###############
 
 set( kbookmarklisttest_SRCS
   kbookmarklisttest.cpp
-  ${SUTDIR}/kbookmarklist.cpp
 )
 
 kde4_add_unit_test( kbookmarklisttest  TESTNAME libokteta-core-kbookmarklisttest  ${kbookmarklisttest_SRCS} )
-target_link_libraries( kbookmarklisttest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( kbookmarklisttest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
Index: core/tests/util/fill.cpp
===================================================================
--- core/tests/util/fill.cpp	(wersja 807254)
+++ core/tests/util/fill.cpp	(kopia robocza)
@@ -35,7 +35,7 @@
 
 
 // fills the buffer with char from b to e
-void textureByteArrayModel( KAbstractByteArrayModel *byteArrayModel,
+OKTETACORETESTUTIL_EXPORT void textureByteArrayModel( KAbstractByteArrayModel *byteArrayModel,
                             unsigned char b, unsigned char e,
                             unsigned int From, int To )
 {
@@ -60,7 +60,7 @@
 }
 
 
-void textureByteArrayModel( KAbstractByteArrayModel *byteArrayModel,
+OKTETACORETESTUTIL_EXPORT void textureByteArrayModel( KAbstractByteArrayModel *byteArrayModel,
                             unsigned char b, unsigned char e,
                             const KSection &section )
 {
@@ -68,7 +68,7 @@
 }
 
 
-void textureByteArray( QByteArray *byteArray,
+OKTETACORETESTUTIL_EXPORT void textureByteArray( QByteArray *byteArray,
                        unsigned char b, unsigned char e,
                        unsigned int From, int To )
 {
@@ -93,7 +93,7 @@
 }
 
 
-void textureByteArray( QByteArray *byteArray,
+OKTETACORETESTUTIL_EXPORT void textureByteArray( QByteArray *byteArray,
                        unsigned char b, unsigned char e,
                        const KSection &section )
 {
Index: core/tests/util/fill.h
===================================================================
--- core/tests/util/fill.h	(wersja 807254)
+++ core/tests/util/fill.h	(kopia robocza)
@@ -23,7 +23,19 @@
 #ifndef OKTETACORE_TEST_UTIL_FILL_H
 #define OKTETACORE_TEST_UTIL_FILL_H
 
+// KDE
+#include <kdemacros.h>
 
+#ifndef OKTETACORETESTUTIL_EXPORT
+  // building the library?
+# if defined(MAKE_OKTETACORETESTUTIL_LIB)
+#  define OKTETACORETESTUTIL_EXPORT KDE_EXPORT
+  // using the library
+# else
+#  define OKTETACORETESTUTIL_EXPORT KDE_IMPORT
+# endif
+#endif
+
 class QByteArray;
 namespace KHE { class KSection; }
 namespace KHECore { class KAbstractByteArrayModel; }
@@ -35,19 +47,19 @@
 static const char PaintChar = 1;
 static const char BlankChar = '\0';
 
-void textureByteArrayModel( KHECore::KAbstractByteArrayModel *ByteArrayModel,
+OKTETACORETESTUTIL_EXPORT void textureByteArrayModel( KHECore::KAbstractByteArrayModel *ByteArrayModel,
                             unsigned char b = 1, unsigned char e = 255,
                             unsigned int From = 0, int To = -1 );
 
-void textureByteArrayModel( KHECore::KAbstractByteArrayModel *byteArrayModel,
+OKTETACORETESTUTIL_EXPORT void textureByteArrayModel( KHECore::KAbstractByteArrayModel *byteArrayModel,
                             unsigned char b, unsigned char e,
                             const KHE::KSection &section );
 
-void textureByteArray( QByteArray *byteArray,
+OKTETACORETESTUTIL_EXPORT void textureByteArray( QByteArray *byteArray,
                        unsigned char b = 1, unsigned char e = 255,
                        unsigned int From = 0, int To = -1 );
 
-void textureByteArray( QByteArray *byteArray,
+OKTETACORETESTUTIL_EXPORT void textureByteArray( QByteArray *byteArray,
                        unsigned char b, unsigned char e,
                        const KHE::KSection &section );
 
Index: core/kabstractbytearraymodel.h
===================================================================
--- core/kabstractbytearraymodel.h	(wersja 807254)
+++ core/kabstractbytearraymodel.h	(kopia robocza)
@@ -38,11 +38,11 @@
 class ArrayChangeMetricsList;
 }
 
+using namespace KHE;
+
 namespace KHECore
 {
 
-using namespace KHE;
-
 /** could it be useful to hide the data access behind an iterator? *
 class KDataBufferIterator
 {
Index: core/CMakeLists.txt
===================================================================
--- core/CMakeLists.txt	(wersja 807254)
+++ core/CMakeLists.txt	(kopia robocza)
@@ -58,6 +58,6 @@
 
 add_subdirectory( piecetable/tests )
 add_subdirectory( tests )
-if(KDE4_BUILD_TESTS)
-  kde4_add_library( testoktetacore STATIC ${oktetacore_LIB_SRCS} )
-endif(KDE4_BUILD_TESTS)
+#if(KDE4_BUILD_TESTS)
+#  kde4_add_library( testoktetacore STATIC ${oktetacore_LIB_SRCS} )
+#endif(KDE4_BUILD_TESTS)
Index: core/piecetable/tests/CMakeLists.txt
===================================================================
--- core/piecetable/tests/CMakeLists.txt	(wersja 807254)
+++ core/piecetable/tests/CMakeLists.txt	(kopia robocza)
@@ -9,23 +9,21 @@
 
 set( piecetest_SRCS
   piecetest.cpp
-  ${SUTDIR}/ksection.cpp
 )
 
 kde4_add_unit_test( piecetest  TESTNAME libpiecetable-piecetest  ${piecetest_SRCS} )
-target_link_libraries( piecetest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( piecetest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### piecetabletest ###############
 
 set( piecetabletest_SRCS
   piecetabletest.cpp
-  ${SUTDIR}/ksection.cpp
   ${SUTDIR}/piecetable/piecetable.cpp
 )
 
 kde4_add_unit_test( piecetabletest  TESTNAME libpiecetable-piecetabletest  ${piecetabletest_SRCS} )
-target_link_libraries( piecetabletest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( piecetabletest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### testpiecetablechangetest ###############
@@ -33,7 +31,6 @@
 set( testpiecetablechangetest_SRCS
   testpiecetablechangetest.cpp
   testpiecetablechange.cpp
-  ${SUTDIR}/ksection.cpp
   ${SUTDIR}/piecetable/piecetable.cpp
   ${SUTDIR}/piecetable/abstractpiecetablechange.cpp
 )
@@ -42,7 +39,7 @@
   TESTNAME libpiecetable-testpiecetablechangetest
   ${testpiecetablechangetest_SRCS}
 )
-target_link_libraries( testpiecetablechangetest  oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( testpiecetablechangetest oktetacore oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### abstractpiecetablechangeiftestsources ###############
@@ -50,7 +47,6 @@
 set( abstractpiecetablechangeiftest_SRCS
   abstractpiecetablechangeiftest.cpp
   testpiecetablechange.cpp
-  ${SUTDIR}/ksection.cpp
   ${SUTDIR}/piecetable/piecetable.cpp
   ${SUTDIR}/piecetable/abstractpiecetablechange.cpp
 )
@@ -67,7 +63,7 @@
   ${testpiecetablechangeabstractpiecetablechangeiftest_SRCS}
 )
 target_link_libraries( testpiecetablechangeabstractpiecetablechangeiftest
-  oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+  oktetacore oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### insertpiecetablechangeabstractpiecetablechangeiftest ###############
@@ -83,7 +79,7 @@
   ${insertpiecetablechangeabstractpiecetablechangeiftest_SRCS}
 )
 target_link_libraries( insertpiecetablechangeabstractpiecetablechangeiftest
-  oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+  oktetacore oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### removepiecetablechangeabstractpiecetablechangeiftest ###############
@@ -99,7 +95,7 @@
   ${removepiecetablechangeabstractpiecetablechangeiftest_SRCS}
 )
 target_link_libraries( removepiecetablechangeabstractpiecetablechangeiftest
-  oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+  oktetacore oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### replacepiecetablechangeabstractpiecetablechangeiftest ###############
@@ -115,7 +111,7 @@
   ${replacepiecetablechangeabstractpiecetablechangeiftest_SRCS}
 )
 target_link_libraries( replacepiecetablechangeabstractpiecetablechangeiftest
-  oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+  oktetacore oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### swaprangespiecetablechangeabstractpiecetablechangeiftest ###############
@@ -131,7 +127,7 @@
   ${swaprangespiecetablechangeabstractpiecetablechangeiftest_SRCS}
 )
 target_link_libraries( swaprangespiecetablechangeabstractpiecetablechangeiftest
-  oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+  oktetacore oktetacoretestutil ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### piecetablechangehistorytest ###############
@@ -139,8 +135,6 @@
 set( piecetablechangehistorytest_SRCS
   piecetablechangehistorytest.cpp
   testpiecetablechange.cpp
-  ${SUTDIR}/ksection.cpp
-  ${SUTDIR}/ksectionlist.cpp
   ${SUTDIR}/piecetable/piecetable.cpp
   ${SUTDIR}/piecetable/abstractpiecetablechange.cpp
   ${SUTDIR}/piecetable/insertpiecetablechange.cpp
@@ -154,15 +148,13 @@
   TESTNAME libpiecetable-piecetablechangehistorytest
   ${piecetablechangehistorytest_SRCS}
 )
-target_link_libraries( piecetablechangehistorytest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( piecetablechangehistorytest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
 
 
 ########### revertablepiecetabletest ###############
 
 set( revertablepiecetabletest_SRCS
   revertablepiecetabletest.cpp
-  ${SUTDIR}/ksection.cpp
-  ${SUTDIR}/ksectionlist.cpp
   ${SUTDIR}/piecetable/piecetable.cpp
   ${SUTDIR}/piecetable/abstractpiecetablechange.cpp
   ${SUTDIR}/piecetable/insertpiecetablechange.cpp
@@ -177,4 +169,4 @@
   TESTNAME libpiecetable-revertablepiecetabletest
   ${revertablepiecetabletest_SRCS}
 )
-target_link_libraries( revertablepiecetabletest  ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
+target_link_libraries( revertablepiecetabletest oktetacore ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIBRARY} )
Index: core/kfixedsizebytearraymodel.h
===================================================================
--- core/kfixedsizebytearraymodel.h	(wersja 807254)
+++ core/kfixedsizebytearraymodel.h	(kopia robocza)
@@ -36,7 +36,7 @@
   *@author Friedrich W. H. Kossebau
   */
 
-class KFixedSizeByteArrayModel : public KAbstractByteArrayModel
+class OKTETACORE_EXPORT KFixedSizeByteArrayModel : public KAbstractByteArrayModel
 {
   public:
     /** creates a readonly buffer around the given data */
Index: core/ksectionlist.h
===================================================================
--- core/ksectionlist.h	(wersja 807254)
+++ core/ksectionlist.h	(kopia robocza)
@@ -34,14 +34,14 @@
 /**
 @author Friedrich W. H.  Kossebau
 */
-class KSectionList : public QLinkedList<KSection>
+class OKTETACORE_EXPORT KSectionList : public QLinkedList<KSection>
 {
   public:
     KSectionList();
     ~KSectionList();
 
   public:
-    void addSection( KSection S );
+    void addSection( const KSection& newSection );
 };
 
 }