[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/blogilo/src
From:       Mehrdad Momeny <mehrdad.momeny () gmail ! com>
Date:       2010-11-15 16:15:12
Message-ID: 20101115161512.7ABB8AC8A0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1197383 by momeny:

WebKit content mimetype sets to xhtml to tell it to add end tag for BR, IMG & etc \
tags. Blogspot complains about missing of this end tag. Spell check and Code actions \
removed from UI because didn't ported to new editor yet.

 M  +3 -2      composer/TextEditorInitialHtml  
 M  +4 -6      composer/texteditor.cpp  
 M  +4 -1      editorsettingsbase.ui  
 M  +4 -3      postentry.cpp  


--- trunk/KDE/kdepim/blogilo/src/composer/TextEditorInitialHtml #1197382:1197383
@@ -1,6 +1,7 @@
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" \
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html \
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">  <head>
-
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
 <script type="text/javascript">
 
 function mouseEventHandler(mEvent)
--- trunk/KDE/kdepim/blogilo/src/composer/texteditor.cpp #1197382:1197383
@@ -208,7 +208,7 @@
         QMessageBox::warning ( 0, i18n ( "TextEditor" ),
                                i18n ( "TextEditor: Cannot open template file." ) );
     else
-        webView -> setHtml ( QString ( file.readAll() ) );
+        webView -> setContent ( file.readAll(), "application/xhtml+xml" );
 
     connect ( webView->page(), SIGNAL ( selectionChanged() ), this, SLOT ( \
                adjustActions() ) );
     connect ( webView->page(), SIGNAL ( selectionChanged() ), this, SIGNAL ( \
selectionChanged() ) ); @@ -272,7 +272,7 @@
     actCheckSpelling->setCheckable( true );
     connect( actCheckSpelling, SIGNAL( triggered( bool ) ), this,
              SLOT( slotToggleSpellChecking(bool) ) );
-    barVisual->addAction( actCheckSpelling );
+//     barVisual->addAction( actCheckSpelling ); FIXME: Missing functionality
 
     barVisual->addSeparator();
     actBold = new KAction( KIcon( "format-text-bold" ), i18nc(
@@ -311,7 +311,7 @@
                            "Code" ), this );
     actCode->setCheckable( true );
     connect( actCode, SIGNAL( triggered( bool ) ), this, SLOT( slotToggleCode(bool) \
                ) );
-    barVisual->addAction( actCode );
+//     barVisual->addAction( actCode ); FIXME: Missing functionality
 
     barVisual->addSeparator();
 
@@ -769,9 +769,7 @@
 QString TextEditor::getHtml() const
 {
     QString html = const_cast<TextEditor*>( this )->evaluateJavaScript( "getHtml()", \
                false ).toString();
-//     HtmlParser *htmlParser = HtmlParser::htmlParser();
-//     int iterator = 0;
-//     while ( htmlParser->setTagAttribute ( html, iterator, "img", "src", "" ) );
+    html.remove(" xmlns=\"http://www.w3.org/1999/xhtml\"", Qt::CaseInsensitive);
     return html;
 }
 
--- trunk/KDE/kdepim/blogilo/src/editorsettingsbase.ui #1197382:1197383
@@ -70,12 +70,15 @@
    <item row="3" column="0" colspan="2">
     <widget class="QCheckBox" name="kcfg_urlCachingEnabled">
      <property name="text">
-      <string>Enable URL caching in the "Add Link" dialog</string>
+      <string>Enable URL caching in the &quot;Add Link&quot; dialog</string>
      </property>
     </widget>
    </item>
    <item row="1" column="0" colspan="2">
     <widget class="QCheckBox" name="kcfg_enableCheckSpelling">
+     <property name="enabled">
+      <bool>false</bool>
+     </property>
      <property name="text">
       <string>Enable spell checking</string>
      </property>
--- trunk/KDE/kdepim/blogilo/src/postentry.cpp #1197382:1197383
@@ -221,11 +221,12 @@
 
 QString PostEntry::htmlContent()
 {
-
-    if ( d->tabWidget->currentIndex() == 0 ) {
+    if ( d->tabWidget->currentIndex() == 1 ) {
+        d->wysiwygEditor->setHtmlContent( d->htmlEditor->document()->text() );
+    } else {
         d->htmlEditor->document()->setText( d->wysiwygEditor->htmlContent() );
     }
-    return d->wysiwygEditor->htmlContent();
+    return d->htmlEditor->document()->text();
 }
 
 QString PostEntry::plainTextContent()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic